From e52204ccca0381d3649f16647cb631236403aa72 Mon Sep 17 00:00:00 2001 From: John Spray Date: Fri, 25 Sep 2015 13:23:01 +0100 Subject: [PATCH] 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 --- src/client/Client.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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; -- 2.47.3