]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: assert to confirm that we don't access violation
authorxie xingguo <xie.xingguo@zte.com.cn>
Fri, 8 Jul 2016 01:48:03 +0000 (09:48 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Fri, 8 Jul 2016 12:44:42 +0000 (20:44 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/bluestore_types.h

index f0e2702e96bdd83891ef4b05d76bf92120bc68e7..2c1846da2beda09fc92a7bd7c68f2a72de3bf428 100644 (file)
@@ -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);