]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: ignore 0x2000~2000 extent oddity from luminous upgrade 17845/head
authorSage Weil <sage@redhat.com>
Wed, 20 Sep 2017 16:38:46 +0000 (12:38 -0400)
committerSage Weil <sage@redhat.com>
Wed, 20 Sep 2017 16:38:46 +0000 (12:38 -0400)
Luminous does a block_size granularity freelist, and assumes that
0~ROUND_UP_TO(SUPER_RESERVED,block_size) is used.  Current master uses
min_alloc_size granularity and changes that assumption to
0~ROUND_UP_TO(SUPER_RESERVED,min_alloc_size).  That means if master
fsck's a luminous-created bluestore, it will think 0x2000~2000 is used
(current baked-in min_alloc_size-based assumption) but the old freelist
says it is free (old mkfs assumption).  The disparity is harmless since
the extent is below min_alloc_size, so ignore it.

Fixes: http://tracker.ceph.com/issues/21408
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc

index 4da6b6b26c3ec3914411d2387f34d7fe674adbd9..f959176235ffea4e0585a8f98dbaac559fbf7605 100644 (file)
@@ -6011,10 +6011,22 @@ int BlueStore::_fsck(bool deep, bool repair)
         }
       );
       if (intersects) {
-       derr << "fsck error: free extent 0x" << std::hex << offset
-            << "~" << length << std::dec
-            << " intersects allocated blocks" << dendl;
-       ++errors;
+       if (offset == SUPER_RESERVED &&
+           length == min_alloc_size - SUPER_RESERVED) {
+         // this is due to the change just after luminous to min_alloc_size
+         // granularity allocations, and our baked in assumption at the top
+         // of _fsck that 0~ROUND_UP_TO(SUPER_RESERVED,min_alloc_size) is used
+         // (vs luminous's ROUND_UP_TO(SUPER_RESERVED,block_size)).  harmless,
+         // since we will never allocate this region below min_alloc_size.
+         dout(10) << __func__ << " ignoring free extent between SUPER_RESERVED"
+                  << " and min_alloc_size, 0x" << std::hex << offset << "~"
+                  << length << dendl;
+       } else {
+         derr << "fsck error: free extent 0x" << std::hex << offset
+              << "~" << length << std::dec
+              << " intersects allocated blocks" << dendl;
+         ++errors;
+       }
       }
     }
     fm->enumerate_reset();