]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix potential re-evaluate stray dentry in _unlink_local_finish 26474/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:55:59 +0000 (19:55 -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 b8633c4945fe15e63f0dd0ec99ea386edc83f369..95cf75d2acb6aea0a8ff12acfb2ee2e1e234f97f 100644 (file)
@@ -193,6 +193,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);
   }