From: Sage Weil Date: Tue, 2 Feb 2016 18:52:43 +0000 (-0500) Subject: os/bluestore/BlueStore: fix wal tail block padding on zero X-Git-Tag: v10.0.4~35^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=96f23eb2124aaa0cb5940fcdf1957b2d8eb5c10e;p=ceph.git os/bluestore/BlueStore: fix wal tail block padding on zero Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 0c4dc2d3321b..52486ccac232 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -5668,7 +5668,6 @@ int BlueStore::_zero(TransContext *txc, } uint64_t x_len = MIN(offset + length - bp->first, bp->second.length) - x_off; - if (bp->second.has_flag(bluestore_extent_t::FLAG_SHARED)) { uint64_t end = bp->first + x_off + x_len; _do_write_zero(txc, c, o, bp->first + x_off, x_len); @@ -5677,6 +5676,11 @@ int BlueStore::_zero(TransContext *txc, bp = o->onode.seek_extent(end - 1); } else { // WAL + uint64_t end = bp->first + x_off + x_len; + if (end >= o->onode.size && end % block_size) { + dout(20) << __func__ << " past eof, padding out tail block" << dendl; + x_len += block_size - (end % block_size); + } bluestore_wal_op_t *op = _get_wal_op(txc, o); op->op = bluestore_wal_op_t::OP_ZERO; op->extent.offset = bp->second.offset + x_off;