]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: don't require bluestore_db_block_size when attaching new 52193/head
authorIgor Fedotov <igor.fedotov@croit.io>
Tue, 7 Mar 2023 12:07:34 +0000 (15:07 +0300)
committerAdam Kupczyk <akupczyk@ibm.com>
Mon, 26 Jun 2023 11:01:47 +0000 (13:01 +0200)
db/wal

Fixes: https://tracker.ceph.com/issues/55260
Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
src/os/bluestore/bluestore_tool.cc

index 41775c8a3070d2fbec4f63f87146176e27b69add..e63616bdd0203bb1ae41a037e88b0ea019bc8025 100644 (file)
@@ -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