]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: only write into a blob region that is allocated
authorSage Weil <sage@redhat.com>
Thu, 19 May 2016 15:58:54 +0000 (11:58 -0400)
committerSage Weil <sage@redhat.com>
Wed, 1 Jun 2016 15:38:52 +0000 (11:38 -0400)
We're only worried about direct writes and wal overwrites; the other write
paths are to freshly allocated blobs.

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc

index 70be36420c253c9868202517e388478aec50f216..1fe1970e462ff52e38db5a2edcee9f4c7b0a5f91 100644 (file)
@@ -5404,6 +5404,7 @@ void BlueStore::_do_write_small(
     uint64_t b_len = length + head_pad + tail_pad;
     if (b->get_ondisk_length() >= b_off + b_len &&
        b->is_unused(b_off, b_len) &&
+       b->is_allocated(b_off, b_len) &&
        (!b->has_csum_data() || (b_off % b->get_csum_block_size() == 0 &&
                                 b_len % b->get_csum_block_size() == 0))) {
       dout(20) << __func__ << "  write to unused 0x" << std::hex
@@ -5469,7 +5470,8 @@ void BlueStore::_do_write_small(
     // chunk-aligned wal overwrite?
     if (b->get_ondisk_length() >= b_off + b_len &&
        b_off % chunk_size == 0 &&
-       b_len % chunk_size == 0) {
+       b_len % chunk_size == 0 &&
+       b->is_allocated(b_off, b_len)) {
       bluestore_wal_op_t *op = _get_wal_op(txc, o);
       op->op = bluestore_wal_op_t::OP_WRITE;
       b->map(b_off, b_len,