]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: ignore 0x2000~2000 extent oddity from luminous upgrade 18050/head
authorSage Weil <sage@redhat.com>
Wed, 20 Sep 2017 16:38:46 +0000 (12:38 -0400)
committerxie xingguo <xie.xingguo@zte.com.cn>
Mon, 2 Oct 2017 02:54:11 +0000 (10:54 +0800)
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>
(cherry picked from commit 4959ad310a96208565b47c035ab5d5dded1b8ff5)

src/os/bluestore/BlueStore.cc

index 3785efc2f28555c27573d3424cd165eb1686d109..94f4ca094fc8000caf02843f4f59ec067c5d4cd8 100644 (file)
@@ -6001,10 +6001,22 @@ int BlueStore::fsck(bool deep)
         }
       );
       if (intersects) {
-       derr << __func__ << " 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();