From ecdfea2ec33178ef0ae1da3089bba9f99932f19e Mon Sep 17 00:00:00 2001 From: Rishabh Dave <ridave@redhat.com> Date: Mon, 20 Feb 2023 12:49:48 +0530 Subject: [PATCH] client: add comment about how quota affect space usage report Add a comment to explain that setting quota on a CephFS directory makes a difference to how much available space on CephFS is reported when that directory serves as the root of the CephFS mount. Signed-off-by: Rishabh Dave <ridave@redhat.com> --- src/client/Client.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/client/Client.cc b/src/client/Client.cc index a7211d5af7e..5c24dbdf398 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -11258,6 +11258,9 @@ int Client::statfs(const char *path, struct statvfs *stbuf, // enabled ceph_assert(cct->_conf.get_val<bool>("client_quota") == false || quota_root != nullptr); + /* If bytes quota is set on a directory and conf option "client quota df" + * is also set, available space = quota limit - used space. Else, + * available space = total space - used space. */ if (quota_root && cct->_conf->client_quota_df && quota_root->quota.max_bytes) { // Skip the getattr if any sessions are stale, as we don't want to