From 359c3863a5b7a622923ac6e0a5a90fa038b0948f Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Fri, 8 Jul 2016 09:48:03 +0800 Subject: [PATCH] os/bluestore: assert to confirm that we don't access violation Signed-off-by: xie xingguo --- src/os/bluestore/bluestore_types.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/os/bluestore/bluestore_types.h b/src/os/bluestore/bluestore_types.h index f0e2702e96bdd..2c1846da2beda 100644 --- a/src/os/bluestore/bluestore_types.h +++ b/src/os/bluestore/bluestore_types.h @@ -362,6 +362,7 @@ struct bluestore_blob_t { assert(p != extents.end()); } while (x_len > 0) { + assert(p != extents.end()); uint64_t l = MIN(p->length - x_off, x_len); f(p->offset + x_off, l); x_off = 0; @@ -382,6 +383,7 @@ struct bluestore_blob_t { bufferlist::iterator it = bl.begin(); uint64_t x_len = bl.length(); while (x_len > 0) { + assert(p != extents.end()); uint64_t l = MIN(p->length - x_off, x_len); bufferlist t; it.copy(l, t); -- 2.39.5