aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_bmap_util.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-04-10 17:40:42 -0400
committerDave Airlie <airlied@redhat.com>2017-04-10 17:40:42 -0400
commitb769fefb68cd70385d68220ae341e5a10723fbc0 (patch)
treea2881410c9dc5a3474619d155fac981cfbd4ee8f /fs/xfs/xfs_bmap_util.c
parent1420f63b8207e966f54caec26d08abdc2ff37193 (diff)
parent39da7c509acff13fc8cb12ec1bb20337c988ed36 (diff)
Backmerge tag 'v4.11-rc6' into drm-next
Linux 4.11-rc6 drm-misc needs 4.11-rc5, may as well fix conflicts with rc6.
Diffstat (limited to 'fs/xfs/xfs_bmap_util.c')
-rw-r--r--fs/xfs/xfs_bmap_util.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
index 8b75dcea5966..828532ce0adc 100644
--- a/fs/xfs/xfs_bmap_util.c
+++ b/fs/xfs/xfs_bmap_util.c
@@ -1311,8 +1311,16 @@ xfs_free_file_space(
1311 /* 1311 /*
1312 * Now that we've unmap all full blocks we'll have to zero out any 1312 * Now that we've unmap all full blocks we'll have to zero out any
1313 * partial block at the beginning and/or end. xfs_zero_range is 1313 * partial block at the beginning and/or end. xfs_zero_range is
1314 * smart enough to skip any holes, including those we just created. 1314 * smart enough to skip any holes, including those we just created,
1315 * but we must take care not to zero beyond EOF and enlarge i_size.
1315 */ 1316 */
1317
1318 if (offset >= XFS_ISIZE(ip))
1319 return 0;
1320
1321 if (offset + len > XFS_ISIZE(ip))
1322 len = XFS_ISIZE(ip) - offset;
1323
1316 return xfs_zero_range(ip, offset, len, NULL); 1324 return xfs_zero_range(ip, offset, len, NULL);
1317} 1325}
1318 1326