]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs: Add some check befor we want to add new data pool 15278/head
authorVicente Cheng <vicente_cheng@bigtera.com>
Tue, 23 May 2017 07:47:35 +0000 (15:47 +0800)
committerVicente Cheng <vicente_cheng@bigtera.com>
Thu, 25 May 2017 02:50:58 +0000 (10:50 +0800)
Signed-off-by: Vicente Cheng <vicente_cheng@bigtera.com>
src/mon/FSCommands.cc

index b36443411d3f94a596c9da65ef5c97bd1e820987..b5b1146385700059e35f885845e939e9768c2d95 100644 (file)
@@ -488,6 +488,12 @@ class AddDataPoolHandler : public FileSystemCommandHandler
       return r;
     }
 
+    // no-op when the data_pool already on fs
+    if (fs->mds_map.is_data_pool(poolid)) {
+      ss << "data pool " << poolid << " is already on fs " << fs_name;
+      return 0;
+    }
+
     fsmap.modify_filesystem(
         fs->fscid,
         [poolid](std::shared_ptr<Filesystem> fs)