From: Sage Weil Date: Mon, 28 Mar 2016 19:35:43 +0000 (-0400) Subject: os/bluestore: _do_write: only use append case for aligned eof X-Git-Tag: v10.1.1~28^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=00a71a0740f16ee643fc7dbfd16428bae425518f;p=ceph.git 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 --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index e9b6b0f780bdf..f2ac814f2feb9 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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);