]> git.apps.os.sepia.ceph.com Git - ceph-ci.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)
committerPere Diaz Bou <pere-altea@hotmail.com>
Fri, 23 Aug 2024 09:49:24 +0000 (11:49 +0200)
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>
(cherry picked from commit 12236c37351aad52b7ff4dc9987120ae22049bf5)

src/os/bluestore/BlueStore.cc

index e9a7c761023d1b5be6b79657920dc15c4b52cbb3..e7ceecadb48117f06b93370f2a629dbbb8fdc8cb 100644 (file)
@@ -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<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)) {