From: John Spray Date: Fri, 31 Jan 2014 16:25:42 +0000 (+0000) Subject: mon: OSDMonitor: Refuse to delete CephFS pools X-Git-Tag: v0.78~216^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c7d265a9b276aad5caf9b35f3ce8bc7bdd169f0f;p=ceph.git mon: OSDMonitor: Refuse to delete CephFS pools 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 --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 1142990af247..a46dc1d6717b 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -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*, "