summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_file.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-05-22 17:50:00 +0200
committerTakashi Iwai <tiwai@suse.de>2014-05-22 17:50:00 +0200
commit0c1d1210160f560841a48641d41b61ec7d05edb2 (patch)
tree14942dc1820fcb9b102b9098e5bacd5b59b78048 /fs/xfs/xfs_file.c
parent6f51f6cf6822f9da02cd91ced4f002024af419bb (diff)
parentcee429e5c53f7ffc1dd500001d9dff567833c23d (diff)
Merge tag 'asoc-v3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next
ASoC: Updates for v3.16 Lots of cleanup work going on in the core this release but very little visible to external users except for the new drivers that have been added. - Support for specifying aux CODECs in DT. - Removal of the deprecated mux and enum macros. - More moves towards full componentisation. - Removal of some unused I/O code. - Lots of cleanups, fixes and enhancements to the davinci, Freescale, Haswell and Realtek drivers. - Several drivers exposed directly in Kconfig for use with simple-card. - New drivers for Cirrus CS42L56, Realtek RT5639, RT5642 and RT5651 and ST STA350.
Diffstat (limited to 'fs/xfs/xfs_file.c')
-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);