]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fix _do_alloc_write compress condition
authorSage Weil <sage@redhat.com>
Fri, 3 Jun 2016 21:21:58 +0000 (17:21 -0400)
committerSage Weil <sage@redhat.com>
Wed, 15 Jun 2016 19:25:29 +0000 (15:25 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc

index b2fd443c483cf63839b518a7f46aa4766cd4557d..ddc787cf7d4238e145c8cdacd0b03bb47146927e 100644 (file)
@@ -5921,11 +5921,12 @@ int BlueStore::_do_alloc_write(
     size_t csum_order = wctx->csum_order;
     bufferlist compressed_bl;
     CompressorRef c;
-    if (b_off == 0 &&
-       wctx->compress &&
+    if (wctx->compress &&
        b->length > min_alloc_size &&
        (c = compressor) != nullptr) {
       // compress
+      assert(b_off == 0);
+      assert(b->length == l->length());
       bluestore_compression_header_t chdr;
       chdr.type = c->get_type();
       // FIXME: memory alignment here is bad