]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: fix quote enforcement on subdir mounts 6082/head
authorJohn Spray <john.spray@redhat.com>
Fri, 25 Sep 2015 12:23:01 +0000 (13:23 +0100)
committerJohn Spray <john.spray@redhat.com>
Fri, 25 Sep 2015 12:24:00 +0000 (13:24 +0100)
While we don't allow setting quotas on the global
filesystem root, the inode which is root from the
client mount's point of view might have a quota.

Signed-off-by: John Spray <john.spray@redhat.com>
src/client/Client.cc

index d73d0bb3a4003900a08595fba74d1145719e2c2a..9a3d3157c6d25d91a00ac440df1deffaa6d1313e 100644 (file)
@@ -11044,13 +11044,19 @@ bool Client::check_quota_condition(
   if (!cct->_conf->client_quota)
     return false;
 
-  while (in != root_ancestor) {
+  while (true) {
     assert(in != NULL);
     if (test(*in)) {
       return true;
     }
 
-    in = get_quota_root(in);
+    if (in == root_ancestor) {
+      // We're done traversing, drop out
+      return false;
+    } else {
+      // Continue up the tree
+      in = get_quota_root(in);
+    }
   }
 
   return false;