os/bluestore: _do_write: only use append case for aligned eof

The append case here only works if the EOF was aligned
and there is thus no partial-block zeroing we need to
do.  If the condition fails, we fall through to the
generic WAL path below.

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2016-03-28 15:35:43 -04:00
parent 9aaf1b195a
commit 00a71a0740

View File

@ -5475,11 +5475,11 @@ int BlueStore::_do_write(
assert(offset >= bp->first);
assert(offset + length <= bp->first + bp->second.length);
// (pad and) overwrite unused portion of extent for an append?
// overwrite unused portion of extent for an append?
if (offset > bp->first &&
offset >= o->onode.size && // past eof +
(offset / block_size != (o->onode.size - 1) / block_size)) {// diff block
dout(20) << __func__ << " append" << dendl;
offset >= o->onode.size && // past eof +
(o->onode.size & ~block_mask) == 0) { // eof was aligned
dout(20) << __func__ << " append after aligned eof" << dendl;
_pad_zeros(txc, o, &bl, &offset, &length, block_size);
assert(offset % block_size == 0);
assert(length % block_size == 0);