Merge pull request #14073 from liewegas/wip-bluestore-nullptr

os/bluestore: avoid nullptr in bluestore_extent_ref_map_t::bound_encode

Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Sage Weil 2017-03-23 20:44:59 -05:00 committed by GitHub
commit 8275fda6de

View File

@ -224,10 +224,12 @@ struct bluestore_extent_ref_map_t {
void bound_encode(size_t& p) const {
denc_varint((uint32_t)0, p);
size_t elem_size = 0;
denc_varint_lowz((uint32_t)0, p);
((const record_t*)nullptr)->bound_encode(elem_size);
p += elem_size * ref_map.size();
if (!ref_map.empty()) {
size_t elem_size = 0;
denc_varint_lowz((uint64_t)0, elem_size);
ref_map.begin()->second.bound_encode(elem_size);
p += elem_size * ref_map.size();
}
}
void encode(bufferlist::contiguous_appender& p) const {
uint32_t n = ref_map.size();