summaryrefslogtreecommitdiff
path: root/fs/xfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-02-15 08:02:50 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2019-02-17 11:55:54 -0800
commit19c8e4e25866fac5ba7138b902cc45b6d3c8e827 (patch)
tree4abac233bf1bd6426ddd66cdf1a4930ae5c37f52 /fs/xfs
parent4ad765edb02a5333ce2fade642f116a67a3370ca (diff)
xfs: remove the truncate short cut in xfs_map_blocks
Now that we properly handle the race with truncate in the delalloc allocator there is no need to short cut this exceptional case earlier on. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_aops.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index 42017ecf78ed..a6abb7125203 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -420,26 +420,6 @@ xfs_map_blocks(
xfs_iunlock(ip, XFS_ILOCK_SHARED);
wpc->fork = XFS_COW_FORK;
-
- /*
- * Truncate can race with writeback since writeback doesn't
- * take the iolock and truncate decreases the file size before
- * it starts truncating the pages between new_size and old_size.
- * Therefore, we can end up in the situation where writeback
- * gets a CoW fork mapping but the truncate makes the mapping
- * invalid and we end up in here trying to get a new mapping.
- * bail out here so that we simply never get a valid mapping
- * and so we drop the write altogether. The page truncation
- * will kill the contents anyway.
- */
- if (offset > i_size_read(inode)) {
- wpc->imap.br_blockcount = end_fsb - offset_fsb;
- wpc->imap.br_startoff = offset_fsb;
- wpc->imap.br_startblock = HOLESTARTBLOCK;
- wpc->imap.br_state = XFS_EXT_NORM;
- return 0;
- }
-
goto allocate_blocks;
}