]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MDSMonitor: add confirm flag to fs reset 3336/head
authorJohn Spray <john.spray@redhat.com>
Mon, 12 Jan 2015 14:52:43 +0000 (14:52 +0000)
committerJohn Spray <john.spray@redhat.com>
Mon, 12 Jan 2015 15:00:15 +0000 (15:00 +0000)
This was already in the command map but was not
being checked.

Signed-off-by: John Spray <john.spray@redhat.com>
src/mon/MDSMonitor.cc

index 9ee5958d8b520b3566edb9cb10e68dfbfbccf7f2..394793a22a825a112b28fb4f7c83395fb126b11c 100644 (file)
@@ -1228,6 +1228,15 @@ int MDSMonitor::management_command(
       return -EINVAL;
     }
 
+    // Check for confirmation flag
+    string sure;
+    cmd_getval(g_ceph_context, cmdmap, "sure", sure);
+    if (sure != "--yes-i-really-mean-it") {
+      ss << "this is a potentially destructive operation, only for use by experts in disaster recovery.  "
+        "Add --yes-i-really-mean-it if you are sure you wish to continue.";
+      return -EPERM;
+    }
+
     MDSMap newmap;
 
     // Populate rank 0 as existing (so don't go into CREATING)