]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: OSDMonitor: Refuse to delete CephFS pools
authorJohn Spray <john.spray@inktank.com>
Fri, 31 Jan 2014 16:25:42 +0000 (16:25 +0000)
committerJohn Spray <john.spray@inktank.com>
Tue, 4 Feb 2014 16:14:36 +0000 (16:14 +0000)
To avoid confusing CephFS, don't permit deletion
of pools which are in use as the metadata pool
or any of the data pools.

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

index 1142990af24733f198dd03f3e0a84a02887a46c3..a46dc1d6717b86b53048c94d58428cf73fc5704d 100644 (file)
@@ -4238,6 +4238,14 @@ done:
       goto reply;
     }
 
+    // If the Pool is in use by CephFS, refuse to delete it
+    MDSMap const &pending_mdsmap = mon->mdsmon()->pending_mdsmap;
+    if (pending_mdsmap.is_data_pool(pool) || pending_mdsmap.get_metadata_pool() == pool) {
+      ss << "Cannot delete pool '" << poolstr << "' because it is in use by CephFS";
+      err = -EBUSY;
+      goto reply;
+    }
+
     if (poolstr2 != poolstr || sure != "--yes-i-really-really-mean-it") {
       ss << "WARNING: this will *PERMANENTLY DESTROY* all data stored in pool " << poolstr
         << ".  If you are *ABSOLUTELY CERTAIN* that is what you want, pass the pool name *twice*, "