From: Kotresh HR Date: Wed, 5 Mar 2025 11:07:51 +0000 (+0530) Subject: mds: Fix mdcache rejoin invented referent inode X-Git-Tag: v20.3.0~377^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=693f058426a4695348482cb07a1f763abe6e6543;p=ceph.git mds: Fix mdcache rejoin invented referent inode 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 ... 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 --- diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc index a4827086257a..1bac7526bed5 100644 --- a/src/mds/CDir.cc +++ b/src/mds/CDir.cc @@ -2400,6 +2400,8 @@ void CDir::_omap_fetched(bufferlist& hdrbl, map& 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) {