]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: pad trailing zeros for WAL write past eof
authorSage Weil <sage@redhat.com>
Fri, 8 Jan 2016 17:26:05 +0000 (12:26 -0500)
committerSage Weil <sage@redhat.com>
Fri, 8 Jan 2016 18:10:20 +0000 (13:10 -0500)
If we're past EOF, we need to zero the rest of the block.

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc

index 915a9086dedba7d0fa8613fbe404778fc0ddc48f..a99fda36eeb77a65878d3cd276902d22b7e1f621 100644 (file)
@@ -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);