From 6026975e1f1fe054264a66b6ac8b0ff301e3813e Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Fri, 7 Mar 2025 17:36:33 +0530 Subject: [PATCH] mon: Make use_global_snaprealm and allow_referent_inodes dependant 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 --- src/mon/FSCommands.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/mon/FSCommands.cc b/src/mon/FSCommands.cc index 7f795235a4ff7..8455a79c9a0d2 100644 --- a/src/mon/FSCommands.cc +++ b/src/mon/FSCommands.cc @@ -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) -- 2.39.5