From: Igor Fedotov Date: Tue, 7 Mar 2023 12:07:34 +0000 (+0300) Subject: os/bluestore: don't require bluestore_db_block_size when attaching new X-Git-Tag: v19.0.0~858^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=9c3a8980bab0dd98185b0bb751c0dac09a9ab79e;p=ceph-ci.git os/bluestore: don't require bluestore_db_block_size when attaching new db/wal Fixes: https://tracker.ceph.com/issues/55260 Signed-off-by: Igor Fedotov --- diff --git a/src/os/bluestore/bluestore_tool.cc b/src/os/bluestore/bluestore_tool.cc index 41775c8a307..e63616bdd02 100644 --- a/src/os/bluestore/bluestore_tool.cc +++ b/src/os/bluestore/bluestore_tool.cc @@ -878,17 +878,17 @@ int main(int argc, char **argv) return {"", false}; } std::error_code ec; - fs::path target_path = fs::weakly_canonical(fs::path{dev_target}, ec); + fs::path target = fs::weakly_canonical(fs::path{dev_target}, ec); if (ec) { cerr << "failed to retrieve absolute path for " << dev_target << ": " << ec.message() << std::endl; exit(EXIT_FAILURE); } - return {target_path.native(), - (fs::exists(target_path) && - fs::is_regular_file(target_path) && - fs::file_size(target_path) > 0)}; + return {target.native(), + fs::exists(target) && + (fs::is_block_file(target) || + (fs::is_regular_file(target) && fs::file_size(target) > 0))}; }(); // Attach either DB or WAL volume, create if needed // check if we need additional size specification