]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix potential re-evaluate stray dentry in _unlink_local_finish 26473/head
authorZhi Zhang <willzzhang@tencent.com>
Tue, 12 Feb 2019 02:44:31 +0000 (10:44 +0800)
committerPrashant D <pdhange@redhat.com>
Mon, 18 Feb 2019 00:19:40 +0000 (19:19 -0500)
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>
(cherry picked from commit 72c93baac64211e9f02fa01e743451bf5d63d7a6)

Conflicts:
src/mds/MDCache.h : Resolved in notify_stray

src/mds/MDCache.h

index 6b23ca0781fd69e470706407a2d09226600a793e..04f5b6a55da915b5dd6e4d76355c3a3a057d6838 100644 (file)
@@ -192,6 +192,9 @@ public:
    */
   void notify_stray(CDentry *dn) {
     assert(dn->get_dir()->get_inode()->is_stray());
+    if (dn->state_test(CDentry::STATE_PURGING))
+      return;
+
     stray_manager.eval_stray(dn);
   }