From 2c4157ae5070f3da273faaff8eff91d34165c8c9 Mon Sep 17 00:00:00 2001 From: David Chinner Date: Sat, 10 Feb 2007 18:36:35 +1100 Subject: [PATCH] --- yaml --- r: 47853 b: refs/heads/master c: 549054afadae44889c0b40d4c3bfb0207b98d5a0 h: refs/heads/master i: 47851: 6cfcf66b743875b24b4d243bfb5b257db0f7e6e1 v: v3 --- [refs] | 2 +- trunk/fs/xfs/linux-2.6/xfs_aops.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 7746a3b9fa1d..a5e5f9d8f8f9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5478eead8528f6cb5ebe3015fb88b68b175e1093 +refs/heads/master: 549054afadae44889c0b40d4c3bfb0207b98d5a0 diff --git a/trunk/fs/xfs/linux-2.6/xfs_aops.c b/trunk/fs/xfs/linux-2.6/xfs_aops.c index 9761a5befef0..f3cc4ab20ba0 100644 --- a/trunk/fs/xfs/linux-2.6/xfs_aops.c +++ b/trunk/fs/xfs/linux-2.6/xfs_aops.c @@ -1283,13 +1283,18 @@ __xfs_get_blocks( bh_result->b_bdev = iomap.iomap_target->bt_bdev; /* - * If we previously allocated a block out beyond eof and we are - * now coming back to use it then we will need to flag it as new - * even if it has a disk address. + * If we previously allocated a block out beyond eof and we are now + * coming back to use it then we will need to flag it as new even if it + * has a disk address. + * + * 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 (create && ((!buffer_mapped(bh_result) && !buffer_uptodate(bh_result)) || - (offset >= i_size_read(inode)) || (iomap.iomap_flags & IOMAP_NEW))) + (offset >= i_size_read(inode)) || + (iomap.iomap_flags & (IOMAP_NEW|IOMAP_UNWRITTEN)))) set_buffer_new(bh_result); if (iomap.iomap_flags & IOMAP_DELAY) {