From: Sage Weil Date: Thu, 12 Oct 2017 13:48:46 +0000 (-0500) Subject: ceph-bluestore-tool: only infer devs if devs.empty() X-Git-Tag: v12.2.2~133^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a128aad320e99c396ff17bcaadb48866667b87df;p=ceph.git ceph-bluestore-tool: only infer devs if devs.empty() Signed-off-by: Sage Weil (cherry picked from commit 2d217367af0df5e18394b1c6179d92db3c0b4448) --- diff --git a/src/os/bluestore/bluestore_tool.cc b/src/os/bluestore/bluestore_tool.cc index c1b44ced8e05..e0c6176d61e6 100644 --- a/src/os/bluestore/bluestore_tool.cc +++ b/src/os/bluestore/bluestore_tool.cc @@ -195,12 +195,14 @@ int main(int argc, char **argv) cerr << "must specify bluestore path *or* raw device(s)" << std::endl; exit(EXIT_FAILURE); } - cout << "infering bluefs devices from bluestore path" << std::endl; - for (auto fn : {"block", "block.wal", "block.db"}) { - string p = path + "/" + fn; - struct stat st; - if (::stat(p.c_str(), &st) == 0) { - devs.push_back(p); + if (devs.empty()) { + cout << "infering bluefs devices from bluestore path" << std::endl; + for (auto fn : {"block", "block.wal", "block.db"}) { + string p = path + "/" + fn; + struct stat st; + if (::stat(p.c_str(), &st) == 0) { + devs.push_back(p); + } } } }