diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-04-10 15:13:06 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-04-10 15:13:06 +0200 |
commit | 523aa3586ffb1fc11a9bf88f77ebaf71a15eb998 (patch) | |
tree | 1fe96f54e8f1e667798a49ae4b3f951feb136ae0 /fs/xfs/xfs_bmap_util.c | |
parent | fd0f50db2eb72555ef8f70af14c1e3ee2079b32c (diff) | |
parent | 39da7c509acff13fc8cb12ec1bb20337c988ed36 (diff) |
Merge 4.11-rc6 into driver-core-next
We want the fixes in here as well for testing.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/xfs/xfs_bmap_util.c')
-rw-r--r-- | fs/xfs/xfs_bmap_util.c | 10 |
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( /* * Now that we've unmap all full blocks we'll have to zero out any * partial block at the beginning and/or end. xfs_zero_range is - * smart enough to skip any holes, including those we just created. + * smart enough to skip any holes, including those we just created, + * but we must take care not to zero beyond EOF and enlarge i_size. */ + + if (offset >= XFS_ISIZE(ip)) + return 0; + + if (offset + len > XFS_ISIZE(ip)) + len = XFS_ISIZE(ip) - offset; + return xfs_zero_range(ip, offset, len, NULL); } |