From b4c08aac9650d3914134fdfff727110aa002bb71 Mon Sep 17 00:00:00 2001 From: Adam Kupczyk Date: Thu, 8 Feb 2024 22:51:32 +0000 Subject: [PATCH] os/bluestore: Fix of bdev label fsck Procedure that verifies allocations vs freelist was not aware of bdev labels. Now it properly omits them in comparisons between free and freelist. Signed-off-by: Adam Kupczyk (cherry picked from commit 12236c37351aad52b7ff4dc9987120ae22049bf5) --- src/os/bluestore/BlueStore.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index e9a7c761023..e7ceecadb48 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -11013,6 +11013,17 @@ int BlueStore::_fsck_on_open(BlueStore::FSCKDepth depth, bool repair) // skip freelist vs allocated compare when we have Null fm if (!fm->is_null_manager()) { dout(1) << __func__ << " checking freelist vs allocated" << dendl; + //unmark extra bdev copies, will collide with the check + for (uint64_t location : bdev_label_valid_locations) { + uint64_t length = std::max(BDEV_LABEL_BLOCK_SIZE, alloc_size); + if (location != BDEV_LABEL_POSITION) { + apply_for_bitset_range(location, length, alloc_size, used_blocks, + [&](uint64_t pos, mempool_dynamic_bitset& bs) { + bs.reset(pos); + } + ); + } + } fm->enumerate_reset(); uint64_t offset, length; while (fm->enumerate_next(db, &offset, &length)) { -- 2.39.5