From: xie xingguo Date: Wed, 14 Jun 2017 07:28:30 +0000 (+0800) Subject: os/bluestore: add sanity check when appending pextents of blob X-Git-Tag: v12.1.0~117^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fb34a4b3d0028eb837d8626f4bd298ae109a8766;p=ceph.git os/bluestore: add sanity check when appending pextents of blob Signed-off-by: xie xingguo --- diff --git a/src/os/bluestore/bluestore_types.cc b/src/os/bluestore/bluestore_types.cc index fdb14ebd86cbf..659f3e5bcc068 100644 --- a/src/os/bluestore/bluestore_types.cc +++ b/src/os/bluestore/bluestore_types.cc @@ -781,6 +781,7 @@ void bluestore_blob_t::allocated(uint32_t b_off, uint32_t length, const AllocExt auto start_it = extents.begin(); size_t pos = 0; while(true) { + assert(start_it != extents.end()); if (cur_offs + start_it->length > b_off) { break; } @@ -793,6 +794,7 @@ void bluestore_blob_t::allocated(uint32_t b_off, uint32_t length, const AllocExt auto end_it = start_it; while (true) { + assert(end_it != extents.end()); assert(!end_it->is_valid()); if (cur_offs + end_it->length >= end_off) { break;