]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: set FLAG_NOPGCHANGE for crimson pools, disallow unsetting it
authorSamuel Just <sjust@redhat.com>
Fri, 14 Oct 2022 01:53:24 +0000 (18:53 -0700)
committerSamuel Just <sjust@redhat.com>
Tue, 14 Feb 2023 06:36:35 +0000 (22:36 -0800)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/mon/OSDMonitor.cc

index 4300633b2d7a2f5ebb0c711e73867a25c3729f1d..a358736d2160773c71ebc9c4cc29562559fd5e78 100644 (file)
@@ -8172,8 +8172,10 @@ int OSDMonitor::prepare_new_pool(string& name,
     pi->use_gmt_hitset = true;
   else
     pi->use_gmt_hitset = false;
-  if (crimson)
+  if (crimson) {
     pi->set_flag(pg_pool_t::FLAG_CRIMSON);
+    pi->set_flag(pg_pool_t::FLAG_NOPGCHANGE);
+  }
 
   pi->size = size;
   pi->min_size = min_size;
@@ -8621,6 +8623,10 @@ int OSDMonitor::prepare_command_pool_set(const cmdmap_t& cmdmap,
     if (val == "true" || (interr.empty() && n == 1)) {
       p.set_flag(flag);
     } else if (val == "false" || (interr.empty() && n == 0)) {
+      if (flag == pg_pool_t::FLAG_NOPGCHANGE && p.is_crimson()) {
+       ss << "cannot clear FLAG_NOPGCHANGE on a crimson pool";
+       return -EINVAL;
+      }
       p.unset_flag(flag);
     } else {
       ss << "expecting value 'true', 'false', '0', or '1'";