Skip to content

Commit

Permalink
os/bluestore: pad trailing zeros for WAL write past eof
Browse files Browse the repository at this point in the history
If we're past EOF, we need to zero the rest of the block.

Signed-off-by: Sage Weil <sage@redhat.com>
  • Loading branch information
liewegas committed Jan 8, 2016
1 parent 139d1fc commit 3bdc89a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/os/bluestore/BlueStore.cc
Expand Up @@ -5117,6 +5117,10 @@ int BlueStore::_do_write(
if (offset + length == orig_offset + orig_length && cow_rmw_tail) {
op->src_rmw_tail = cow_rmw_tail;
dout(20) << __func__ << " src_rmw_tail " << op->src_rmw_tail << dendl;
} else if (((offset + length) & ~block_mask) &&
offset + length > o->onode.size) {
dout(20) << __func__ << " past eof, padding out tail block" << dendl;
_pad_zeros_tail(o, &bl, offset, &length, block_size);
}
bp->second.clear_flag(bluestore_extent_t::FLAG_COW_HEAD);
bp->second.clear_flag(bluestore_extent_t::FLAG_COW_TAIL);
Expand Down

0 comments on commit 3bdc89a

Please sign in to comment.