From 28e7d5645e5fdf5471a2a809bd232521f2d33814 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 20 Sep 2017 12:38:46 -0400 Subject: [PATCH] os/bluestore: ignore 0x2000~2000 extent oddity from luminous upgrade 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 (cherry picked from commit 4959ad310a96208565b47c035ab5d5dded1b8ff5) --- src/os/bluestore/BlueStore.cc | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 3785efc2f2855..94f4ca094fc80 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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(); -- 2.39.5