From: Adam Kupczyk Date: Thu, 16 Feb 2023 12:21:53 +0000 (+0000) Subject: os/bluestore: Fix ExtentMap::reshard X-Git-Tag: v19.0.0~486^2~35 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d085aab853ca6562cf2490d5e156fcd6582a17f7;p=ceph.git os/bluestore: Fix ExtentMap::reshard When reshard is applied for the first time, expand reshard range to encompas whole object. Signed-off-by: Adam Kupczyk --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 43f6e0f345f3..42d8338ffae9 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -2767,6 +2767,12 @@ void BlueStore::ExtentMap::reshard( dout(20) << __func__ << " shards [" << si_begin << "," << si_end << ")" << " over 0x[" << std::hex << needs_reshard_begin << "," << needs_reshard_end << ")" << std::dec << dendl; + } else { + // When sharding is not applied yet, it is an error to request reshard on range. + // The problem is that reshard() function will not touch any extent outside the range. + // Thus initial reshard() must encompass whole object. + needs_reshard_begin = 0; + needs_reshard_end = OBJECT_MAX_SIZE; } fault_range(db, needs_reshard_begin, (needs_reshard_end - needs_reshard_begin));