From: Igor Fedotov Date: Sat, 15 Feb 2025 14:44:20 +0000 (+0300) Subject: tools/bluestore-tool: dump label locations with "show-label" cmd X-Git-Tag: testing/wip-khiremat-testing-20250424.121018-squid-debug~19^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6457c53a82d10f2df23cb1c3be5b434c3ac7d2f7;p=ceph-ci.git tools/bluestore-tool: dump label locations with "show-label" cmd Signed-off-by: Igor Fedotov (cherry picked from commit 97bbbb11b3b4c5e5c69059f3c07a3d026efc8261) --- diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index a66669dd947..58ba1e9b4b5 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -3449,7 +3449,7 @@ public: const std::string &path, bluestore_bdev_label_t *out_label, std::vector* 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, diff --git a/src/os/bluestore/bluestore_tool.cc b/src/os/bluestore/bluestore_tool.cc index 6073babad19..0d18eaf2c9e 100644 --- a/src/os/bluestore/bluestore_tool.cc +++ b/src/os/bluestore/bluestore_tool.cc @@ -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 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(); }