]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: add sanity check when appending pextents of blob 15680/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Wed, 14 Jun 2017 07:28:30 +0000 (15:28 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 15 Jun 2017 09:11:23 +0000 (17:11 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/bluestore_types.cc

index fdb14ebd86cbf5c8eeb01f4b8391b43ab243a098..659f3e5bcc06823b35fa866b40c435988867829e 100644 (file)
@@ -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;