From a4152dbfa1bc7c75fbe1baea273a9c42a87e1b3f Mon Sep 17 00:00:00 2001 From: John Spray Date: Mon, 12 Jan 2015 14:52:43 +0000 Subject: [PATCH] mon/MDSMonitor: add confirm flag to fs reset This was already in the command map but was not being checked. Signed-off-by: John Spray --- src/mon/MDSMonitor.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 9ee5958d8b520..394793a22a825 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -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) -- 2.39.5