]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix potential re-evaluate stray dentry in _unlink_local_finish 26374/head
authorZhi Zhang <willzzhang@tencent.com>
Tue, 12 Feb 2019 02:44:31 +0000 (10:44 +0800)
committerZhi Zhang <willzzhang@tencent.com>
Tue, 12 Feb 2019 02:44:31 +0000 (10:44 +0800)
If MDS handles cap release before _unlink_local_finish, then when MDS
processes _unlink_local_finish, eval_stray might be re-entered twice,
so this will cause crashing.

Fixes: http://tracker.ceph.com/issues/38263
Signed-off-by: Zhi Zhang <zhangz.david@outlook.com>
src/mds/MDCache.h

index 9e13cfda0fd635dc1161404d8ffb3231b6ddbeed..c49778af116008f6e893630e9e0d2eaccabc1209 100644 (file)
@@ -196,6 +196,9 @@ public:
    */
   void notify_stray(CDentry *dn) {
     ceph_assert(dn->get_dir()->get_inode()->is_stray());
+    if (dn->state_test(CDentry::STATE_PURGING))
+      return;
+
     stray_manager.eval_stray(dn);
   }