]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore/bluestore-tool: omit device from both source and taget 28893/head
authorIgor Fedotov <ifedotov@suse.com>
Wed, 19 Jun 2019 14:26:25 +0000 (17:26 +0300)
committerIgor Fedotov <ifedotov@suse.com>
Fri, 5 Jul 2019 09:04:47 +0000 (12:04 +0300)
lists when migrating.

Signed-off-by: Igor Fedotov <ifedotov@suse.com>
(cherry picked from commit 5ea89a4e0c2d6988156e76c074ae755632b51d53)

src/os/bluestore/bluestore_tool.cc

index 5e6b481cefd58ae10a7a15e5dc90e7ebfbf42ae3..bdc5869b5120fec9593bd1056b529687471048b2 100644 (file)
@@ -691,8 +691,14 @@ int main(int argc, char **argv)
     for (auto& s :  devs_source) {
       auto i = cur_devs_map.find(s);
       if (i != cur_devs_map.end()) {
-       src_devs.emplace(*i);
-       src_dev_ids.emplace(i->second);
+        if (s == dev_target) {
+         cerr << "Device " << dev_target
+              << " is present in both source and target lists, omitted."
+              << std::endl;
+        } else {
+         src_devs.emplace(*i);
+         src_dev_ids.emplace(i->second);
+       }
       } else {
        cerr << "can't migrate " << s << ", not a valid bluefs volume "
              << std::endl;