]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: skip fetching the dirfrags if not a directory
authorXiubo Li <xiubli@redhat.com>
Wed, 23 Feb 2022 14:21:11 +0000 (22:21 +0800)
committerXiubo Li <xiubli@redhat.com>
Tue, 30 Aug 2022 02:43:01 +0000 (10:43 +0800)
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 <xiubli@redhat.com>
(cherry picked from commit 655a6d878f9f4939b74fd9d010b9e017a33247c0)

src/mds/OpenFileTable.cc

index 6b0e9d16337bd0b8ce575e2444c7a830daa3a28a..687ddc3e95d47fbbdbe8723c05343cdd06f0dabf 100644 (file)
@@ -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;