From 980e017372d16b9782b2cb9b2282309d0b62564b Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Fri, 11 Mar 2016 14:30:53 -0800 Subject: [PATCH] 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 --- src/mon/MDSMonitor.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index a680be73c7155..b41bc0115ae67 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); -- 2.39.5