]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: improve comments for ENOTEMPTY checks 9787/head
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 17 Jun 2016 16:00:59 +0000 (12:00 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 17 Jun 2016 17:48:25 +0000 (13:48 -0400)
There are two checks in the code for ENOTEMPTY, clarify that the first check is
doing a fast check without locks.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mds/Server.cc

index d804a8ac68c24d0db023244faa9e7ead5ded4bb8..02883b96fba709cf0e827d9b406ce0cf0842bfc5 100644 (file)
@@ -6099,7 +6099,7 @@ void Server::handle_client_rename(MDRequestRef& mdr)
       return;
     }
 
-    // non-empty dir?
+    // non-empty dir? do trivial fast unlocked check, do another check later with read locks
     if (oldin->is_dir() && _dir_is_nonempty_unlocked(mdr, oldin)) {
       respond_to_request(mdr, -ENOTEMPTY);
       return;
@@ -6309,6 +6309,7 @@ void Server::handle_client_rename(MDRequestRef& mdr)
   if (!check_access(mdr, srci, MAY_WRITE))
     return;
 
+  // with read lock, really verify oldin is empty
   if (oldin &&
       oldin->is_dir() &&
       _dir_is_nonempty(mdr, oldin)) {