diff options
author | Kukjin Kim <kgene.kim@samsung.com> | 2014-05-30 13:36:49 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2014-05-30 13:36:49 -0400 |
commit | fced6dee29f6fb143fe16ea90331176ff77e6120 (patch) | |
tree | 5b6e57e7a757adc2a6518ce291a4d2914397b917 /fs/xfs/xfs_file.c | |
parent | bfed1074f213051e94648bfad0d0611a16d81366 (diff) | |
parent | be1f7c8d7e2bc8b8c76846aa6f276e8d2ef8975a (diff) |
Merge branch 'v3.16-next/cleanup-samsung' into v3.16-next/platform-exynos
Diffstat (limited to 'fs/xfs/xfs_file.c')
-rw-r--r-- | fs/xfs/xfs_file.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index 79e96ce98733..951a2321ee01 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c | |||
@@ -679,7 +679,7 @@ xfs_file_dio_aio_write( | |||
679 | goto out; | 679 | goto out; |
680 | 680 | ||
681 | if (mapping->nrpages) { | 681 | if (mapping->nrpages) { |
682 | ret = -filemap_write_and_wait_range(VFS_I(ip)->i_mapping, | 682 | ret = filemap_write_and_wait_range(VFS_I(ip)->i_mapping, |
683 | pos, -1); | 683 | pos, -1); |
684 | if (ret) | 684 | if (ret) |
685 | goto out; | 685 | goto out; |
@@ -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); |