]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: Fix of bdev label fsck
authorAdam Kupczyk <akupczyk@ibm.com>
Thu, 8 Feb 2024 22:51:32 +0000 (22:51 +0000)
committerAdam Kupczyk <akupczyk@ibm.com>
Mon, 22 Jul 2024 12:36:28 +0000 (12:36 +0000)
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 <akupczyk@ibm.com>
src/os/bluestore/BlueStore.cc

index a8d10a648b9f911020e75cb0d045a981b722bab0..f6819c49aaa7c8dc5e314f01ffc2b0f4e1954e86 100644 (file)
@@ -11244,6 +11244,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<uint64_t>(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)) {