From 2d217367af0df5e18394b1c6179d92db3c0b4448 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 12 Oct 2017 08:48:46 -0500 Subject: [PATCH] ceph-bluestore-tool: only infer devs if devs.empty() Signed-off-by: Sage Weil --- src/os/bluestore/bluestore_tool.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/os/bluestore/bluestore_tool.cc b/src/os/bluestore/bluestore_tool.cc index c1b44ced8e0..e0c6176d61e 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); + } } } } -- 2.39.5