From: Igor Golikov Date: Mon, 9 Feb 2026 13:48:39 +0000 (+0000) Subject: mds: move checks to safe location X-Git-Tag: testing/wip-vshankar-testing-20260222.101816~3^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=34cdd9b8f656559b0e19f8f37a059bdddec30cb9;p=ceph-ci.git mds: move checks to safe location for the broadcast_quota_to_client function Signed-off-by: Igor Golikov --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 70a0b6bcf95..1ca5cd33b86 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -2124,9 +2124,12 @@ void MDCache::broadcast_quota_to_client(CInode *in, client_t exclude_ct, bool qu if (!(mds->is_active() || mds->is_stopping())) return; + if (!in->is_auth() || in->is_frozen()) + return; + const auto& pi = in->get_projected_inode(); - // creaete snaprealm for quota inode (quota was set before mimic) + // create snaprealm for quota inode (quota was set before mimic) if (!in->get_projected_srnode()) mds->server->create_quota_realm(in); @@ -2140,7 +2143,7 @@ void MDCache::broadcast_quota_to_client(CInode *in, client_t exclude_ct, bool qu << " rbytes=" << pi->rstat.rbytes << dendl; - // Update subvolume quota cache in MetricsHandler even if we return early. + // Update subvolume quota cache in MetricsHandler. // Update when quota is enabled OR when there's a quota change (e.g., removing quota). // This ensures cache is updated to 0 when quota is set to unlimited. // Pass both quota and current used_bytes from this inode. @@ -2155,9 +2158,6 @@ void MDCache::broadcast_quota_to_client(CInode *in, client_t exclude_ct, bool qu force_zero); } - if (!in->is_auth() || in->is_frozen()) - return; - if (!pi->quota.is_enabled() && !quota_change) return;