summaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-04-27 21:36:39 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-04-27 21:36:39 -0700
commitd35cc56ddfc948d8df1aa6d41ac345fcec01854d (patch)
tree7e23a0e3dde639236e019aa88309d919941958e5 /fs/xfs
parent86d56134f1b67d0c18025ba5cade95c048ed528d (diff)
parentd1db0eea852497762cab43b905b879dfcd3b8987 (diff)
downloadlinux-d35cc56ddfc948d8df1aa6d41ac345fcec01854d.tar.bz2
Merge 3.15-rc3 into staging-next
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_file.c10
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(
goto out_unlock;
}
- ASSERT(offset + len < i_size_read(inode));
+ /*
+ * There is no need to overlap collapse range with EOF,
+ * in which case it is effectively a truncate operation
+ */
+ if (offset + len >= i_size_read(inode)) {
+ error = -EINVAL;
+ goto out_unlock;
+ }
+
new_size = i_size_read(inode) - len;
error = xfs_collapse_file_space(ip, offset, len);