]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: handle race between stray reintegration and rmdir
authorYan, Zheng <zyan@redhat.com>
Mon, 6 Mar 2017 03:08:20 +0000 (11:08 +0800)
committerYan, Zheng <zyan@redhat.com>
Thu, 30 Mar 2017 01:46:05 +0000 (09:46 +0800)
It's possible that stray reintegration tries moving stray to a
removed directory.

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
src/mds/Server.cc

index 86f1d5c85835c291712aa2388641a8ca9838b3c9..9f549af7f1ca9f498e124b6c8037af6630633c1b 100644 (file)
@@ -2637,10 +2637,10 @@ CDentry* Server::rdlock_path_xlock_dentry(MDRequestRef& mdr, int n,
       respond_to_request(mdr, -EROFS);
       return 0;
     }
-    if (!diri->is_base() && diri->get_projected_parent_dir()->inode->is_stray()) {
-      respond_to_request(mdr, -ENOENT);
-      return 0;
-    }
+  }
+  if (!diri->is_base() && diri->get_projected_parent_dir()->inode->is_stray()) {
+    respond_to_request(mdr, -ENOENT);
+    return 0;
   }
 
   // make a null dentry?