]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
tools/bluestore-tool: dump label locations with "show-label" cmd
authorIgor Fedotov <ifedotov@croit.io>
Sat, 15 Feb 2025 14:44:20 +0000 (17:44 +0300)
committerIgor Fedotov <igor.fedotov@croit.io>
Tue, 15 Apr 2025 09:04:23 +0000 (12:04 +0300)
Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
(cherry picked from commit 97bbbb11b3b4c5e5c69059f3c07a3d026efc8261)

src/os/bluestore/BlueStore.h
src/os/bluestore/bluestore_tool.cc

index a66669dd947f0901b3f3a298508e545ed2480cd5..58ba1e9b4b5f5dcf647cddd9ee8998b7b4950501 100644 (file)
@@ -3449,7 +3449,7 @@ public:
     const std::string &path,
     bluestore_bdev_label_t *out_label,
     std::vector<uint64_t>* out_valid_positions = nullptr,
-    bool* out_is_cloned = nullptr,
+    bool* out_is_multi = nullptr,
     int64_t* out_epoch = nullptr);
   static int write_bdev_label(
     CephContext* cct, const std::string &path,
index 6073babad19312c78e5f204b2c7da5fd12df9912..0d18eaf2c9ecb9aaffb307869cf96ebda4b45a5b 100644 (file)
@@ -724,13 +724,19 @@ int main(int argc, char **argv)
     for (auto& i : devs) {
       jf.open_object_section(i.c_str());
       bluestore_bdev_label_t label;
-      int r = BlueStore::read_bdev_label(cct.get(), i, &label);
+      std::vector<uint64_t> valid_positions;
+      int r = BlueStore::read_bdev_label(cct.get(), i, &label, &valid_positions);
       if (r < 0) {
         cerr << "unable to read label for " << i << ": "
              << cpp_strerror(r) << std::endl;
       } else {
         any_success = true;
         label.dump(&jf);
+        jf.open_array_section("locations");
+        for (int64_t pos : valid_positions) {
+          jf.dump_format("", "0x%llx", pos);
+        }
+        jf.close_section();
       }
       jf.close_section();
     }