]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: disallow changing pg_num_actual if pool has FLAG_NOPGCHANGE
authorSamuel Just <sjust@redhat.com>
Fri, 14 Oct 2022 01:52:33 +0000 (18:52 -0700)
committerSamuel Just <sjust@redhat.com>
Tue, 14 Feb 2023 06:36:35 +0000 (22:36 -0800)
The corresponding pg_num, pgp_num, and pgp_num_actual cases already have
this guard.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/mon/OSDMonitor.cc

index c8d715ed3ac43c6de6da7e8803ebf53a33c1a91d..da123baff62615ea9fc0785499297b9b90a0b0c1 100644 (file)
@@ -8422,6 +8422,10 @@ int OSDMonitor::prepare_command_pool_set(const cmdmap_t& cmdmap,
     }
     p.min_size = n;
   } else if (var == "pg_num_actual") {
+    if (p.has_flag(pg_pool_t::FLAG_NOPGCHANGE)) {
+      ss << "pool pg_num change is disabled; you must unset nopgchange flag for the pool first";
+      return -EPERM;
+    }
     if (interr.length()) {
       ss << "error parsing integer value '" << val << "': " << interr;
       return -EINVAL;