Skip to content

Commit

Permalink
os/bluestore: fix potential access violation during shard-key scan
Browse files Browse the repository at this point in the history
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
  • Loading branch information
xiexingguo committed Sep 23, 2016
1 parent dfa65e2 commit dcfbc72
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/os/bluestore/BlueStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3936,13 +3936,18 @@ int BlueStore::fsck()
expecting_shards.pop_front();
continue;
}
while (expecting_shards.empty() ||
expecting_shards.front() > it->key()) {
uint32_t offset;
string okey;
get_key_extent_shard(it->key(), &okey, &offset);
derr << __func__ << " stray shard 0x" << std::hex << offset << std::dec
<< dendl;

uint32_t offset;
string okey;
get_key_extent_shard(it->key(), &okey, &offset);
derr << __func__ << " stray shard 0x" << std::hex << offset << std::dec
<< dendl;
if (expecting_shards.empty()) {
derr << __func__ << pretty_binary_string(it->key())
<< " is unexpected" << dendl;
continue;
}
while (expecting_shards.front() > it->key()) {
derr << __func__ << " saw " << pretty_binary_string(it->key())
<< dendl;
derr << __func__ << " exp "
Expand Down

0 comments on commit dcfbc72

Please sign in to comment.