Repository navigation
mds: expose multiversion hardlink inode changes in snapdiff - #70953
Merged
vshankar merged 1 commit intoSep 7, 2026
Merged
Conversation
Contributor
|
Thanks for the patch. I am reviewing it. |
vshankar
reviewed
Aug 13, 2026
| const bool inode_state_authoritative = head && head->is_auth(); | ||
| bool inode_spans_both = | ||
| inode_state_authoritative && | ||
| snapid_prev >= in->first && snapid <= in->last; |
Contributor
There was a problem hiding this comment.
Good catch. The MDS does treat the hardlink case by making the inode multiversioned while keeping the dentry unchanged.
build_snap_diff() skipped any dentry whose [first,last] range spanned both compared snapshots, assuming such a dentry cannot have changed. That does not hold for multiversion inodes: a hardlinked inode (nlink > 1) is COWed on modification without necessarily COWing either of its dentries, so the dentry range stays unchanged while the inode itself gains a new version. As a result snapdiff reported no change for every path of a modified hardlink, and cephfs-mirror replicated the snapshot while leaving the destination file contents stale. Compare the inode versions visible at each snapshot instead of relying on the dentry range alone. Historical metadata in old_inodes is authoritative only on the inode auth MDS. When this rank holds a replica, report the entry conservatively rather than silently dropping an update. Fixes: https://tracker.ceph.com/issues/79275 Signed-off-by: Li Sheng <[email protected]>
LiShengG
force-pushed
the
wip-mds-snapdiff-hardlink-multiversion
branch
from
August 14, 2026 12:05
30dae25 to
5a55a3f
Compare
Contributor
Author
|
I found and fixed an issue in the new libcephfs test helper: the I amended the commit to initialize the outputs. The production |
Contributor
|
This PR has been added to main integration testing by vshankar started 2026-08-31-13:37. |
Contributor
|
jenkins retest this please |
vshankar
approved these changes
Sep 4, 2026
kotreshhr
added a commit
to kotreshhr/ceph
that referenced
this pull request
Sep 7, 2026
When a dentry spans both snapid_prev and snapid, build_snap_diff skips it without comparing metadata. If snapflush is still outstanding, that skip can hide a real change. Add snapflush_pending() using client_snap_caps on snap inodes and client_need_snapflush on HEAD for snaps in [snapid_prev, snapid]. When snapflush is pending, rdlock the filelock first so metadata comparisons run on flushed state, then apply the multiversion hardlink and mtime checks from PR ceph#70953. For the dentry pair compare path, only rdlock when snapflush is pending instead of always rdlocking on equal unlocked metadata. Fixes: https://tracker.ceph.com/issues/74984 Signed-off-by: Kotresh HR <[email protected]>
kotreshhr
added a commit
to kotreshhr/ceph
that referenced
this pull request
Sep 7, 2026
When a dentry spans both snapid_prev and snapid, build_snap_diff skips it without comparing metadata. If snapflush is still outstanding, that skip can hide a real change. Add snapflush_pending() using client_snap_caps on snap inodes and client_need_snapflush on HEAD for snaps in [snapid_prev, snapid]. When snapflush is pending, rdlock the filelock first so metadata comparisons run on flushed state, then apply the multiversion hardlink and mtime checks from PR ceph#70953. For the dentry pair compare path, only rdlock when snapflush is pending instead of always rdlocking on equal unlocked metadata. Fixes: https://tracker.ceph.com/issues/74984 Signed-off-by: Kotresh HR <[email protected]>
kginonredhat
pushed a commit
to kginonredhat/ceph
that referenced
this pull request
Sep 30, 2026
When a dentry spans both snapid_prev and snapid, build_snap_diff skips it without comparing metadata. If snapflush is still outstanding, that skip can hide a real change. Add snapflush_pending() using client_snap_caps on snap inodes and client_need_snapflush on HEAD for snaps in [snapid_prev, snapid]. When snapflush is pending, rdlock the filelock first so metadata comparisons run on flushed state, then apply the multiversion hardlink and mtime checks from PR ceph#70953. For the dentry pair compare path, only rdlock when snapflush is pending instead of always rdlocking on equal unlocked metadata. Fixes: https://tracker.ceph.com/issues/74984 Signed-off-by: Kotresh HR <[email protected]>
dparmar18
pushed a commit
to dparmar18/ceph
that referenced
this pull request
Oct 5, 2026
When a dentry spans both snapid_prev and snapid, build_snap_diff skips it without comparing metadata. If snapflush is still outstanding, that skip can hide a real change. Add snapflush_pending() using client_snap_caps on snap inodes and client_need_snapflush on HEAD for snaps in [snapid_prev, snapid]. When snapflush is pending, rdlock the filelock first so metadata comparisons run on flushed state, then apply the multiversion hardlink and mtime checks from PR ceph#70953. For the dentry pair compare path, only rdlock when snapflush is pending instead of always rdlocking on equal unlocked metadata. Fixes: https://tracker.ceph.com/issues/74984 Signed-off-by: Kotresh HR <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CephFS snapdiff treats a non-directory dentry whose snapshot range spans both operands as unchanged. That is incorrect for multiversion hardlinks: inode COW can create a new inode version without COWing either dentry, so cephfs-mirror can report a successful sync while the destination snapshot retains stale file contents.
Compare the authoritative inode metadata visible at each snapshot before skipping an unchanged-span dentry. Because a replica's inode range and historical inode metadata are not authoritative, report the entry conservatively on replica ranks instead of risking a false negative. Add focused libcephfs and cephfs-mirror coverage, including a hardlink split across auth and replica MDS ranks.
Fixes: https://tracker.ceph.com/issues/79275
Tested with:
ceph_test_libcephfs_snapdiff --gtest_filter=LibCephFS.SnapDiffHardlinkReplicaInodetest_cephfs_mirror_hardlink_snapdiff_visibilitytest_cephfs_mirror_hardlink_snapdiff_replica_inodeChecklist