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: v17.2.4~77^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3a9d2dbf64fb81afedce13b0789b6c898fde68af;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 eea7c0409c52..784baa56c076 100644 --- a/src/mds/OpenFileTable.cc +++ b/src/mds/OpenFileTable.cc @@ -1061,6 +1061,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;