aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_aops.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_aops.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index 7b54461695e2..f3cc4ab20ba0 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -249,7 +249,7 @@ xfs_map_blocks(
249 return -error; 249 return -error;
250} 250}
251 251
252STATIC inline int 252STATIC_INLINE int
253xfs_iomap_valid( 253xfs_iomap_valid(
254 xfs_iomap_t *iomapp, 254 xfs_iomap_t *iomapp,
255 loff_t offset) 255 loff_t offset)
@@ -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) {