From 8f7c932fa021e71f99411827844ae120930afcf1 Mon Sep 17 00:00:00 2001 From: Vicente Cheng Date: Tue, 23 May 2017 15:47:35 +0800 Subject: [PATCH] cephfs: Add some check befor we want to add new data pool Signed-off-by: Vicente Cheng --- src/mon/FSCommands.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mon/FSCommands.cc b/src/mon/FSCommands.cc index b36443411d3f9..b5b1146385700 100644 --- a/src/mon/FSCommands.cc +++ b/src/mon/FSCommands.cc @@ -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 fs) -- 2.39.5