]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: add sanity check to seq_bytes 15836/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Fri, 23 Jun 2017 05:31:08 +0000 (13:31 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 27 Jun 2017 08:55:39 +0000 (16:55 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.cc

index ae87bab35c94e8690eba5235cce221cd3030e89f..86f93a68831ec425f9168544c454b98a3100221d 100644 (file)
@@ -2968,6 +2968,7 @@ void BlueStore::DeferredBatch::_discard(
               << " 0x" << std::hex << p->first << "~" << p->second.bl.length()
               << " -> 0x" << head.length() << std::dec << dendl;
       auto i = seq_bytes.find(p->second.seq);
+      assert(i != seq_bytes.end());
       if (end > offset + length) {
        bufferlist tail;
        tail.substr_of(p->second.bl, offset + length - p->first,
@@ -2982,6 +2983,7 @@ void BlueStore::DeferredBatch::_discard(
       } else {
        i->second -= end - offset;
       }
+      assert(i->second >= 0);
       p->second.bl.swap(head);
     }
     ++p;
@@ -2991,6 +2993,7 @@ void BlueStore::DeferredBatch::_discard(
       break;
     }
     auto i = seq_bytes.find(p->second.seq);
+    assert(i != seq_bytes.end());
     auto end = p->first + p->second.bl.length();
     if (end > offset + length) {
       unsigned drop_front = offset + length - p->first;
@@ -3010,6 +3013,7 @@ void BlueStore::DeferredBatch::_discard(
               << std::dec << dendl;
       i->second -= p->second.bl.length();
     }
+    assert(i->second >= 0);
     p = iomap.erase(p);
   }
 }