]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: MDSMonitor: Forbid removal of first data pool 1173/head
authorJohn Spray <john.spray@inktank.com>
Fri, 31 Jan 2014 17:22:13 +0000 (17:22 +0000)
committerJohn Spray <john.spray@inktank.com>
Tue, 4 Feb 2014 16:17:47 +0000 (16:17 +0000)
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 <john.spray@inktank.com>
src/mon/MDSMonitor.cc

index 0f7bf274eb4591eb8df5ad941d43f75a05de085c..1e81eba9ad802b4c7734e1a6b1f6964a612b3cd6 100644 (file)
@@ -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);