From: Xiubo Li Date: Wed, 23 Feb 2022 14:21:11 +0000 (+0800) Subject: mds: skip fetching the dirfrags if not a directory X-Git-Tag: v16.2.11~334^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5f65d71a7556ed7f20cd84f909c838b1e5b9039d;p=ceph.git mds: skip fetching the dirfrags if not a directory The backtrace in openfile table maybe out-of-date, just skip fetching dirfrags instead of crash the MDS. Fixes: https://tracker.ceph.com/issues/54384 Signed-off-by: Xiubo Li (cherry picked from commit 655a6d878f9f4939b74fd9d010b9e017a33247c0) --- diff --git a/src/mds/OpenFileTable.cc b/src/mds/OpenFileTable.cc index 6b0e9d16337b..687ddc3e95d4 100644 --- a/src/mds/OpenFileTable.cc +++ b/src/mds/OpenFileTable.cc @@ -1058,6 +1058,12 @@ void OpenFileTable::_prefetch_dirfrags() CInode *diri = mdcache->get_inode(ino); if (!diri) continue; + + if (!diri->is_dir()) { + dout(10) << " " << *diri << " is not dir" << dendl; + continue; + } + if (diri->state_test(CInode::STATE_REJOINUNDEF)) continue;