|
@@ -2323,6 +2323,13 @@ static int ext4_da_get_block_prep(struct inode *inode, sector_t iblock,
|
|
|
set_buffer_delay(bh_result);
|
|
|
} else if (ret > 0) {
|
|
|
bh_result->b_size = (ret << inode->i_blkbits);
|
|
|
+ /*
|
|
|
+ * With sub-block writes into unwritten extents
|
|
|
+ * we also need to mark the buffer as new so that
|
|
|
+ * the unwritten parts of the buffer gets correctly zeroed.
|
|
|
+ */
|
|
|
+ if (buffer_unwritten(bh_result))
|
|
|
+ set_buffer_new(bh_result);
|
|
|
ret = 0;
|
|
|
}
|
|
|
|