From: John Spray Date: Fri, 31 Jan 2014 17:22:13 +0000 (+0000) Subject: mon: MDSMonitor: Forbid removal of first data pool X-Git-Tag: v0.78~216^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fdeb18e21f65dc354d023b1bb25e501f5240b28a;p=ceph.git 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 --- 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);