From fb34a4b3d0028eb837d8626f4bd298ae109a8766 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Wed, 14 Jun 2017 15:28:30 +0800 Subject: [PATCH] os/bluestore: add sanity check when appending pextents of blob Signed-off-by: xie xingguo --- src/os/bluestore/bluestore_types.cc | 2 ++ 1 file changed, 2 insertions(+) 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; -- 2.39.5