From: Sage Weil Date: Thu, 19 May 2016 15:58:54 +0000 (-0400) Subject: os/bluestore: only write into a blob region that is allocated X-Git-Tag: v11.0.0~359^2~52 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8bdf2d906c470e4e77a4689c54f45a76eb16920a;p=ceph.git os/bluestore: only write into a blob region that is allocated We're only worried about direct writes and wal overwrites; the other write paths are to freshly allocated blobs. Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 70be36420c25..1fe1970e462f 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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,