aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/xfs/xfs_bmap_util.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
index 2f1e30d39a35..76b6a2910e40 100644
--- a/fs/xfs/xfs_bmap_util.c
+++ b/fs/xfs/xfs_bmap_util.c
@@ -1470,6 +1470,19 @@ xfs_collapse_file_space(
1470 start_fsb = XFS_B_TO_FSB(mp, offset + len); 1470 start_fsb = XFS_B_TO_FSB(mp, offset + len);
1471 shift_fsb = XFS_B_TO_FSB(mp, len); 1471 shift_fsb = XFS_B_TO_FSB(mp, len);
1472 1472
1473 /*
1474 * writeback the entire file to prevent concurrent writeback of ranges
1475 * outside the collapsing region from changing the extent list.
1476 *
1477 * XXX: This is a temporary fix until the extent shift loop below is
1478 * converted to use offsets and lookups within the ILOCK rather than
1479 * carrying around the index into the extent list for the next
1480 * iteration.
1481 */
1482 error = filemap_write_and_wait(VFS_I(ip)->i_mapping);
1483 if (error)
1484 return error;
1485
1473 error = xfs_free_file_space(ip, offset, len); 1486 error = xfs_free_file_space(ip, offset, len);
1474 if (error) 1487 if (error)
1475 return error; 1488 return error;