From fdeb18e21f65dc354d023b1bb25e501f5240b28a Mon Sep 17 00:00:00 2001 From: John Spray Date: Fri, 31 Jan 2014 17:22:13 +0000 Subject: [PATCH] mon: MDSMonitor: Forbid removal of first data pool Because inodes from other pools now store their backtrace on the first/default data pool, it is special and may not be removed. Fixes: 7109 Signed-off-by: John Spray --- src/mon/MDSMonitor.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 0f7bf274eb45..1e81eba9ad80 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -1046,6 +1046,13 @@ bool MDSMonitor::prepare_command(MMonCommand *m) ss << "pool '" << poolname << "' does not exist"; } } + + if (pending_mdsmap.get_first_data_pool() == poolid) { + r = -EINVAL; + poolid = -1; + ss << "cannot remove default data pool"; + } + if (poolid >= 0) { cmd_getval(g_ceph_context, cmdmap, "poolid", poolid); r = pending_mdsmap.remove_data_pool(poolid); -- 2.47.3