int rval = cond.wait();
lock.lock();
- ceph_assert(root);
- total_files_on_fs = root->rstat.rfiles + root->rstat.rsubdirs;
+ ceph_assert(in);
+ // Usually quota_root will == root_ancestor, but if the mount root has no
+ // quota but we can see a parent of it that does have a quota, we'll
+ // respect that one instead.
+ InodeRef quota_root = in->quota.is_enabled() ? in : get_quota_root(in, perms);
+
+ total_files_on_fs = quota_root->rstat.rfiles + quota_root->rstat.rsubdirs;
if (rval < 0) {
ldout(cct, 1) << "underlying call to statfs returned error: "
stbuf->f_flag = 0; // ??
stbuf->f_namemax = NAME_MAX;
- // Usually quota_root will == root_ancestor, but if the mount root has no
- // quota but we can see a parent of it that does have a quota, we'll
- // respect that one instead.
- ceph_assert(root != nullptr);
- InodeRef quota_root = root->quota.is_enabled(QUOTA_MAX_BYTES) ? root : get_quota_root(root.get(), perms, QUOTA_MAX_BYTES);
-
// get_quota_root should always give us something if client quotas are
// enabled
ceph_assert(cct->_conf.get_val<bool>("client_quota") == false || quota_root != nullptr);