]> 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, 14 Jun 2022 09:44:29 +0000 (17:44 +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>
src/mds/OpenFileTable.cc

index 8436e5e7d1d69738b9cdb558c71ad9c418fbc6e9..4322b6a8a7d59cabd985c46ff9526c946001d412 100644 (file)
@@ -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;