]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: add sanity check for underflow
authorxie xingguo <xie.xingguo@zte.com.cn>
Thu, 23 Jun 2016 12:09:01 +0000 (20:09 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 23 Jun 2016 12:09:01 +0000 (20:09 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.h

index 2df1044764630bdf86dfc3fd644c3fc5a4b96e84..1ac611b0f7399cad1b31ef7ab726c7f043a9542b 100644 (file)
@@ -659,6 +659,7 @@ public:
 
     void _rm_buffer(Buffer *b) override {
       if (!b->is_empty()) {
+        assert(buffer_bytes >= b->length);
        buffer_bytes -= b->length;
       }
       switch (b->cache_private) {