From: Dave Chinner Date: Tue, 15 Mar 2016 00:44:35 +0000 (+1100) Subject: Merge branch 'xfs-misc-fixes-4.6-4' into for-next X-Git-Tag: v4.14-rc1~3583^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2cdb958aba6afbced5bc563167813b972b6acbfe;p=platform%2Fkernel%2Flinux-rpi.git Merge branch 'xfs-misc-fixes-4.6-4' into for-next --- 2cdb958aba6afbced5bc563167813b972b6acbfe diff --cc fs/xfs/xfs_aops.c index 75a39a8,eed0bfc..7ba680e --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@@ -1505,22 -1784,15 +1506,23 @@@ xfs_vm_write_failed if (block_start >= to) break; - if (!buffer_delay(bh)) + /* + * Process delalloc and unwritten buffers beyond EOF. We can + * encounter unwritten buffers in the event that a file has + * post-EOF unwritten extents and an extending write happens to + * fail (e.g., an unaligned write that also involves a delalloc + * to the same page). + */ + if (!buffer_delay(bh) && !buffer_unwritten(bh)) continue; - if (!buffer_new(bh) && block_offset < i_size_read(inode)) + if (!xfs_mp_fail_writes(mp) && !buffer_new(bh) && + block_offset < i_size_read(inode)) continue; - xfs_vm_kill_delalloc_range(inode, block_offset, - block_offset + bh->b_size); + if (buffer_delay(bh)) + xfs_vm_kill_delalloc_range(inode, block_offset, + block_offset + bh->b_size); /* * This buffer does not contain data anymore. make sure anyone