]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: Make use_global_snaprealm and allow_referent_inodes dependant
authorKotresh HR <khiremat@redhat.com>
Fri, 7 Mar 2025 12:06:33 +0000 (17:36 +0530)
committerKotresh HR <khiremat@redhat.com>
Fri, 7 Mar 2025 18:39:07 +0000 (00:09 +0530)
We can't disable using global snaprealm without enabling
referent inodes feature and we can't disable referent inodes
without disabling global snaprealm. The patch adds this dependency.

Fixes: https://tracker.ceph.com/issues/54205
Signed-off-by: Kotresh HR <khiremat@redhat.com>
src/mon/FSCommands.cc

index 7f795235a4ff7ae23089de17e509830970fda560..8455a79c9a0d270dfd045f858c1c5fef1fa3cf63 100644 (file)
@@ -605,6 +605,11 @@ int FileSystemCommandHandler::set_val(Monitor *mon, FSMap& fsmap, MonOpRequestRe
         return r;
       }
 
+      if (!allow_referent_inodes && !fsp->get_mds_map().use_global_snaprealm()) {
+       ss << "Error! Can't disable referent inodes, the dependant feature use_global_snaprealm is disabled.";
+        return -EOPNOTSUPP;
+      }
+
       if (!allow_referent_inodes) {
         modify_filesystem(fsmap, fsv,
             [](auto&& fs)
@@ -627,6 +632,11 @@ int FileSystemCommandHandler::set_val(Monitor *mon, FSMap& fsmap, MonOpRequestRe
         return r;
       }
 
+      if (!use_global_snaprealm && !fsp->get_mds_map().allow_referent_inodes()) {
+       ss << "Error! Can't disable global snaprealm, the dependant feature allow_referent_inodes is disabled";
+        return -EOPNOTSUPP;
+      }
+
       if (!use_global_snaprealm) {
         modify_filesystem(fsmap, fsv,
             [](auto&& fs)