]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: Fix mdcache rejoin invented referent inode
authorKotresh HR <khiremat@redhat.com>
Wed, 5 Mar 2025 11:07:51 +0000 (16:37 +0530)
committerKotresh HR <khiremat@redhat.com>
Wed, 5 Mar 2025 11:32:31 +0000 (17:02 +0530)
During mds cache rejoin, the referent inode could
be invented and marked CInode::STATE_REJOINUNDEF.
The same inode is fetched from the disk later and
the state should be cleared. This was missing for
the referent inode and hence was causing the following
crash.

src/mds/StrayManager.cc: 453: FAILED ceph_assert(!in->state_test(CInode::STATE_REJOINUNDEF))

 ceph version Development (no_version) tentacle (dev)
 1: (ceph::__ceph_assert_fail(char const*, char const*, int, char const*)+0x11f) [0x7f3a9880bc58]
 2: (ceph::register_assert_context(ceph::common::CephContext*)+0) [0x7f3a9880be7a]
 3: (StrayManager::_eval_stray(CDentry*)+0x329) [0x56300f4aa5f7]
 4: (StrayManager::eval_stray(CDentry*)+0x1c) [0x56300f4ab0e4]
 5: (MDCache::notify_stray(CDentry*)+0x48) [0x56300f3b6d46]
 6: (Server::_link_remote_finish(boost::intrusive_ptr<MDRequestImpl> ...
 7: (C_MDS_link_remote_finish::finish(int)+0x2e) [0x56300f3e59ee]
 8: (Context::complete(int)+0x9) [0x56300f2b688f]
 9: (MDSContext::complete(int)+0x61) [0x56300f5d3fb1]
 10: (MDSIOContextBase::complete(int)+0x2c4) [0x56300f5d43bc]
 11: (MDSLogContextBase::complete(int)+0x32) [0x56300f5d44d0]
 12: (Finisher::finisher_thread_entry()+0x22c) [0x7f3a987bb878]
 13: (Finisher::FinisherThread::entry()+0xd) [0x7f3a987bc157]
 14: (Thread::entry_wrapper()+0x2f) [0x7f3a987eb4fd]
 15: (Thread::_entry_func(void*)+0x9) [0x7f3a987eb50f]
 16: /lib64/libc.so.6(+0x98088) [0x7f3a974a6088]
 17: /lib64/libc.so.6(+0x11bf8c) [0x7f3a97529f8c]

Fixes: https://tracker.ceph.com/issues/54205
Signed-off-by: Kotresh HR <khiremat@redhat.com>
src/mds/CDir.cc

index a4827086257aa7a6c1d6e40239234dc455c5aee4..1bac7526bed56a3417d704399d895ac5bc78bab4 100644 (file)
@@ -2400,6 +2400,8 @@ void CDir::_omap_fetched(bufferlist& hdrbl, map<string, bufferlist>& omap,
     CDentry::linkage_t *dnl = dn->get_linkage();
     if (dnl->is_primary() && dnl->get_inode()->state_test(CInode::STATE_REJOINUNDEF))
       undef_inodes.push_back(dnl->get_inode());
+    if (dnl->is_referent_remote() && dnl->get_referent_inode()->state_test(CInode::STATE_REJOINUNDEF))
+      undef_inodes.push_back(dnl->get_referent_inode());
   }
 
   if (complete) {