]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: consider async dirops when checking directory empty
authorYan, Zheng <zyan@redhat.com>
Sun, 19 Jan 2020 08:00:06 +0000 (16:00 +0800)
committerYan, Zheng <zyan@redhat.com>
Fri, 31 Jan 2020 13:11:50 +0000 (21:11 +0800)
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
src/mds/Server.cc

index d3cef59f057fa645ee87e6c0b548f07e93bbc8f1..a1ec18ba67670e63e4876f4101479a01d1e379db 100644 (file)
@@ -7472,6 +7472,8 @@ bool Server::_dir_is_nonempty_unlocked(MDRequestRef& mdr, CInode *in)
   dout(10) << "dir_is_nonempty_unlocked " << *in << dendl;
   ceph_assert(in->is_auth());
 
+  if (in->filelock.is_cached())
+    return false; // there can be pending async create/unlink. don't know.
   if (in->snaprealm && in->snaprealm->srnode.snaps.size())
     return true; // in a snapshot!