Repository navigation
client: add defensive checks for LRU pin counter drift - #69970
Conversation
sometimes we hit a SIGSEGV in LRU::adjust() after num_pinned grew larger than the LRU size (num_pinned=2, size=1 in the core dump). Add client-side diagnostics only — no LRU logic changes. Introduce assert_lru_num_pinned_sane() and call it around trim_cache, close_dir parent unpin, and unlink/lru_remove. On drift it logs LRU list sizes (and dentry ref/pin state when known) via lderr, then asserts instead of crashing deep inside LRU::adjust(). Also assert dn->dir is set in trim_dentry/unlink, and log when close_dir drops the parent dentry pin (suspected trigger path). Signed-off-by: Igor Golikov <[email protected]> Fixes: https://tracker.ceph.com/issues/77947
chrisphoffman
left a comment
There was a problem hiding this comment.
A few minor things
Can you discuss testing you did for this? I'd expect it to pass, but with these asserts we need to be sure it does. It will be beneficial to catch any low hanging issues before a teuthology run to save time.
|
I ran a test of the change, no apparent errors caused from this: |
|
jenkins test api |
Replace internal IBMCEPH-14337 references with public tracker URLs and drop the duplicate <sstream> include in Client.h. Signed-off-by: Igor Golikov <[email protected]> Fixes: https://tracker.ceph.com/issues/77947
|
@chrisphoffman , thanks for the review. I have pushed the fix addressing your comments. Can be merged when tests pass |
|
This PR has been added to main integration testing by choffman started 2026-08-06-18:43. |
|
jenkins test api |
|
jenkins test windows |
|
jenkins test make check |
|
jenkins test make check arm64 |
|
This PR has been added to main integration testing by choffman started 2026-08-11-17:22. |
Summary
Client::assert_lru_num_pinned_sane()— checksnum_pinned <= lru_size, logs LRU breakdown (and dentry details when available), thenceph_assertstrim_cache,trim_cache_for_reconnect,close_dirparent unpin,unlinkbeforelru_removeceph_assert(dn->dir)intrim_dentryandunlink; log parent dentry unpin inclose_dirContext
recurrence of tracker client tick thread crashed in
LRU::adjust()viaClient::unlink()→lru_remove(). Core dump showednum_pinned=2, size=1— counter drift, not dentry UAF.This PR adds diagnostics only (no
lru.hchanges, no behavioral fixes)until we can reproduce the drift reliably.
Fixes: https://tracker.ceph.com/issues/77947
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.