diff options
Diffstat (limited to 'fs/xfs/xfs_file.c')
-rw-r--r-- | fs/xfs/xfs_file.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index 82afdcb33183..951a2321ee01 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c | |||
@@ -841,7 +841,15 @@ xfs_file_fallocate( | |||
841 | goto out_unlock; | 841 | goto out_unlock; |
842 | } | 842 | } |
843 | 843 | ||
844 | ASSERT(offset + len < i_size_read(inode)); | 844 | /* |
845 | * There is no need to overlap collapse range with EOF, | ||
846 | * in which case it is effectively a truncate operation | ||
847 | */ | ||
848 | if (offset + len >= i_size_read(inode)) { | ||
849 | error = -EINVAL; | ||
850 | goto out_unlock; | ||
851 | } | ||
852 | |||
845 | new_size = i_size_read(inode) - len; | 853 | new_size = i_size_read(inode) - len; |
846 | 854 | ||
847 | error = xfs_collapse_file_space(ip, offset, len); | 855 | error = xfs_collapse_file_space(ip, offset, len); |