From: Adam Kupczyk Date: Tue, 30 Jan 2024 12:45:05 +0000 (+0000) Subject: os/bluestore: Fix read_meta and write_meta X-Git-Tag: v20.0.0~1321^2~37 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c0bd6fff41ba0c7e5d7a7fe9c7bfc5fa7b90beb4;p=ceph.git os/bluestore: Fix read_meta and write_meta Remove asserts if optional reading of bdev label fails. Pass all valid bdev locations when writing bdev labels. Signed-off-by: Adam Kupczyk --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 8a5ffd49f34e..5e551a1de662 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -6013,16 +6013,15 @@ int BlueStore::write_meta(const std::string& key, const std::string& value) { string p = path + "/block"; if (bdev_label_valid_locations.empty()) { - int r = _read_main_bdev_label(cct, p, &bdev_label, + _read_main_bdev_label(cct, p, &bdev_label, &bdev_label_valid_locations, &bdev_label_multi, &bdev_label_epoch); - ceph_assert(r == 0); } if (!bdev_label_valid_locations.empty()) { bdev_label.meta[key] = value; if (bdev_label_multi) { bdev_label.meta["epoch"] = std::to_string(bdev_label_epoch); } - int r = _write_bdev_label(cct, p, bdev_label); + int r = _write_bdev_label(cct, p, bdev_label, bdev_label_valid_locations); ceph_assert(r == 0); } return ObjectStore::write_meta(key, value); @@ -6032,9 +6031,8 @@ int BlueStore::read_meta(const std::string& key, std::string *value) { string p = path + "/block"; if (bdev_label_valid_locations.empty()) { - int r = _read_main_bdev_label(cct, p, &bdev_label, + _read_main_bdev_label(cct, p, &bdev_label, &bdev_label_valid_locations, &bdev_label_multi, &bdev_label_epoch); - ceph_assert(r == 0); } if (!bdev_label_valid_locations.empty()) { auto i = bdev_label.meta.find(key);