From: Greg Farnum Date: Fri, 11 Mar 2016 22:30:53 +0000 (-0800) Subject: MDSMonitor: check for duplicated fs creation *before* multiple-fs creation X-Git-Tag: v10.1.0~62^2^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F8073%2Fhead;p=ceph.git MDSMonitor: check for duplicated fs creation *before* multiple-fs creation If we check for creating an FS with one already existing first, we will reject (with EINVAL) duplicate attempts to create the same FS with the same params. That makes it non-idempotent, which is bad! Signed-off-by: Greg Farnum --- diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index a680be73c715..b41bc0115ae6 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -1568,14 +1568,6 @@ int MDSMonitor::management_command( return -EINVAL; } - if (pending_fsmap.any_filesystems() - && !pending_fsmap.get_enable_multiple()) { - ss << "Creation of multiple filesystems is disabled. To enable " - "this experimental feature, use 'ceph fs flag set enable_multiple " - "true'"; - return -EINVAL; - } - if (pending_fsmap.get_filesystem(fs_name)) { auto fs = pending_fsmap.get_filesystem(fs_name); if (*(fs->mds_map.data_pools.begin()) == data @@ -1589,6 +1581,14 @@ int MDSMonitor::management_command( } } + if (pending_fsmap.any_filesystems() + && !pending_fsmap.get_enable_multiple()) { + ss << "Creation of multiple filesystems is disabled. To enable " + "this experimental feature, use 'ceph fs flag set enable_multiple " + "true'"; + return -EINVAL; + } + pg_pool_t const *data_pool = mon->osdmon()->osdmap.get_pg_pool(data); assert(data_pool != NULL); // Checked it existed above pg_pool_t const *metadata_pool = mon->osdmon()->osdmap.get_pg_pool(metadata);