]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: reject force-create-pg on pgids that shouldn't exist
authorSage Weil <sage@redhat.com>
Fri, 2 Feb 2018 17:59:29 +0000 (11:59 -0600)
committerSage Weil <sage@redhat.com>
Fri, 2 Feb 2018 18:19:37 +0000 (12:19 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/OSDMonitor.cc

index 0a6cbad9df9bf40e9c1be760396a1c8b0fde6e93..e6b9279003ba4b0db8af4f839a8cf981ad1fb4f6 100644 (file)
@@ -10927,6 +10927,11 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
       err = -EINVAL;
       goto reply;
     }
+    if (!osdmap.pg_exists(pgid)) {
+      ss << "pg " << pgid << " should not exist";
+      err = -ENOENT;
+      goto reply;
+    }
     bool creating_now;
     {
       std::lock_guard<std::mutex> l(creating_pgs_lock);