aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index 9761a5befef..f3cc4ab20ba 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -1283,13 +1283,18 @@ __xfs_get_blocks(
1283 bh_result->b_bdev = iomap.iomap_target->bt_bdev; 1283 bh_result->b_bdev = iomap.iomap_target->bt_bdev;
1284 1284
1285 /* 1285 /*
1286 * If we previously allocated a block out beyond eof and we are 1286 * If we previously allocated a block out beyond eof and we are now
1287 * now coming back to use it then we will need to flag it as new 1287 * coming back to use it then we will need to flag it as new even if it
1288 * even if it has a disk address. 1288 * has a disk address.
1289 *
1290 * With sub-block writes into unwritten extents we also need to mark
1291 * the buffer as new so that the unwritten parts of the buffer gets
1292 * correctly zeroed.
1289 */ 1293 */
1290 if (create && 1294 if (create &&
1291 ((!buffer_mapped(bh_result) && !buffer_uptodate(bh_result)) || 1295 ((!buffer_mapped(bh_result) && !buffer_uptodate(bh_result)) ||
1292 (offset >= i_size_read(inode)) || (iomap.iomap_flags & IOMAP_NEW))) 1296 (offset >= i_size_read(inode)) ||
1297 (iomap.iomap_flags & (IOMAP_NEW|IOMAP_UNWRITTEN))))
1293 set_buffer_new(bh_result); 1298 set_buffer_new(bh_result);
1294 1299
1295 if (iomap.iomap_flags & IOMAP_DELAY) { 1300 if (iomap.iomap_flags & IOMAP_DELAY) {