From: xie xingguo Date: Tue, 13 Jun 2017 06:08:25 +0000 (+0800) Subject: os/bluestore: fix possible wrong initial shard during partial reshard X-Git-Tag: v12.1.0~83^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e0293afca82ad86a04cab006796140392d48aab0;p=ceph.git os/bluestore: fix possible wrong initial shard during partial reshard Signed-off-by: xie xingguo --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index e89986833920..b0c2e223272f 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -2095,7 +2095,7 @@ void BlueStore::ExtentMap::reshard( // reshard unsigned estimate = 0; - unsigned offset = 0; + unsigned offset = needs_reshard_begin; vector new_shard_info; unsigned max_blob_end = 0; Extent dummy(needs_reshard_begin); @@ -2112,11 +2112,11 @@ void BlueStore::ExtentMap::reshard( if (estimate && estimate + extent_avg > target + (would_span ? slop : 0)) { // new shard - if (offset == 0) { + if (offset == needs_reshard_begin) { new_shard_info.emplace_back(bluestore_onode_t::shard_info()); new_shard_info.back().offset = offset; dout(20) << __func__ << " new shard 0x" << std::hex << offset - << std::dec << dendl; + << std::dec << dendl; } offset = e->logical_offset; new_shard_info.emplace_back(bluestore_onode_t::shard_info()); @@ -2126,9 +2126,9 @@ void BlueStore::ExtentMap::reshard( estimate = 0; } estimate += extent_avg; - unsigned bb = e->blob_start(); - if (bb < spanning_scan_begin) { - spanning_scan_begin = bb; + unsigned bs = e->blob_start(); + if (bs < spanning_scan_begin) { + spanning_scan_begin = bs; } uint32_t be = e->blob_end(); if (be > max_blob_end) {