Repository navigation
client: fix ctime advancement on matching atime - #69921
chrisphoffman merged 2 commits into
Conversation
Fix an optimization trap where the client strips CEPH_SETATTR_ATIME from the setattr mask if the requested atime matches the locally cached inode atime. The fix ensures that if the client does not hold EXCL or WR caps, the CEPH_SETATTR_ATIME bit is preserved in the network mask. This forces the MDS to process the transaction, allowing it to execute the mandatory ctime advancement. Fixes: https://tracker.ceph.com/issues/71639 Signed-off-by: Jos Collin <[email protected]>
Orchestrates a multi-client contention scenario using two mounts to explicitly downgrade client_a down to SHARED caps by reading from client_b. It then executes a touch/setattr operation on client_a with an atime value identical to the file's current cached atime. Verifies that ctime is advanced appropriately by the MDS despite the value-equality match, preventing future regressions where the client might strip CEPH_SETATTR_ATIME from the network mask. Fixes: https://tracker.ceph.com/issues/71639 Signed-off-by: Jos Collin <[email protected]>
208cd9d to
97eb8c9
Compare
|
jenkins test api |
|
Test passed with the fix in Client.cc: Test failed as expected without the fix in Client.cc: |
chrisphoffman
left a comment
There was a problem hiding this comment.
Thanks for running the test to validate the fix :).
This looks good to me.
|
This PR has been added to main integration testing by choffman started 2026-08-06-18:43. |
|
This PR has been added to main integration testing by choffman started 2026-08-11-17:22. |
|
I saw this going by in email because of the back ports and some of the context confused me. |
|
I am a little worried because that patch was part of #43286, which went through a LOT of discussion and review. But that focused on our cap semantics, and I think we just totally neglected that you're supposed to update ctime even on no-op setattrs. |
|
Thanks for bringing this up, @gregsfortytwo. You're right about the pattern introduced in #43286. Since this PR was strictly scoped to address the I'll defer to you and @vshankar on whether you'd like to pause the backports for Tracker#71639 or let them proceed while we work on the broader audit in the new tracker. |
This PR addresses issues where file access metadata updates were incorrectly optimized away or skipped by the client when exclusive capabilities (CEPH_CAP_FILE_EXCL) were downgraded to SHARED caps in multi-client scenarios.
Fix ctime bump on matching atime: Ensures that the client preserves CEPH_SETATTR_ATIME in the network mask and flushes the request to the MDS during an explicit setattr(atime) call under SHARED caps, even if the requested timestamp matches the current cached value. This forces the MDS to receive the request and correctly advance the status change time (ctime) for POSIX compliance.
QA Tests: Added dedicated regression test cases (test_ctime_bump_on_matching_atime) in the test suite to validate distributed metadata propagation under SHARED cap constraints.
Fixes: https://tracker.ceph.com/issues/71639
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.