]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds: move checks to safe location
authorIgor Golikov <igolikov@redhat.com>
Mon, 9 Feb 2026 13:48:39 +0000 (13:48 +0000)
committerIgor Golikov <igolikov@redhat.com>
Mon, 9 Feb 2026 13:48:39 +0000 (13:48 +0000)
for the broadcast_quota_to_client function

Signed-off-by: Igor Golikov <igolikov@redhat.com>
src/mds/MDCache.cc

index 70a0b6bcf95ecbaec2d7b99a312ce00362ed5019..1ca5cd33b86d42b101525d00cbe4b522be8e3b12 100644 (file)
@@ -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;