From: John Spray Date: Fri, 25 Sep 2015 12:23:01 +0000 (+0100) Subject: client: fix quote enforcement on subdir mounts X-Git-Tag: v9.1.0~59^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F6082%2Fhead;p=ceph.git client: fix quote enforcement on subdir mounts 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 --- diff --git a/src/client/Client.cc b/src/client/Client.cc index d73d0bb3a400..9a3d3157c6d2 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -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;