]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: ensure snapclient is synced before corruption check 56398/head
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 1 Feb 2024 14:15:37 +0000 (09:15 -0500)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 22 Mar 2024 14:31:45 +0000 (10:31 -0400)
During resolve, orphan dirfrags are purged which may result in dentry commits.
If the snapclient is not sync'd (which normally happens as the last step of
up:resolve), then the snapclient indicates the last sequence is 1 which is
always less than a dentry's legitimate "first" value.

Fixes: https://tracker.ceph.com/issues/64058
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit caa34c1f6102f88e2c07f58af72bd886cbcc33b3)

src/mds/CDentry.cc

index b6d169b9e0f857a1b4e10b3c89d49278fec9f70e..6722f0f2a3670663849d4b1b7ba4cac5be955158 100644 (file)
@@ -702,7 +702,7 @@ bool CDentry::check_corruption(bool load)
 {
   auto&& snapclient = dir->mdcache->mds->snapclient;
   auto next_snap = snapclient->get_last_seq()+1;
-  if (first > last || (snapclient->is_server_ready() && first > next_snap)) {
+  if (first > last || (snapclient->is_synced() && first > next_snap)) {
     if (load) {
       dout(1) << "loaded already corrupt dentry: " << *this << dendl;
       corrupt_first_loaded = true;