summaryrefslogtreecommitdiffstats
path: root/fs/iomap.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-07-14 22:57:32 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-14 22:57:32 -0700
commita80099a152d0719e2d8d750e07f4ffa991553d30 (patch)
treefc2d76c18e09220c0ddbdb6575662dd23e1782e0 /fs/iomap.c
parentbc243704fb3c97f3631994bbe543782a09482afb (diff)
parentd6ab17f261919d212ec0a9e33d01f46df0ec1fde (diff)
downloadlinux-a80099a152d0719e2d8d750e07f4ffa991553d30.tar.gz
linux-a80099a152d0719e2d8d750e07f4ffa991553d30.tar.bz2
linux-a80099a152d0719e2d8d750e07f4ffa991553d30.zip
Merge tag 'xfs-4.13-merge-6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Pull XFS fixes from Darrick Wong: "Largely debugging and regression fixes. - Add some locking assertions for the _ilock helpers. - Revert the XFS_QMOPT_NOLOCK patch; after discussion with hch the online fsck patch that would have needed it has been redesigned and no longer needs it. - Fix behavioral regression of SEEK_HOLE/DATA with negative offsets to match 4.12-era XFS behavior" * tag 'xfs-4.13-merge-6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: vfs: in iomap seek_{hole,data}, return -ENXIO for negative offsets Revert "xfs: grab dquots without taking the ilock" xfs: assert locking precondition in xfs_readlink_bmap_ilocked xfs: assert locking precondŃ–tion in xfs_attr_list_int_ilocked xfs: fixup xfs_attr_get_ilocked
Diffstat (limited to 'fs/iomap.c')
-rw-r--r--fs/iomap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/iomap.c b/fs/iomap.c
index 173222863aca..039266128b7f 100644
--- a/fs/iomap.c
+++ b/fs/iomap.c
@@ -610,8 +610,8 @@ iomap_seek_hole(struct inode *inode, loff_t offset, const struct iomap_ops *ops)
loff_t length = size - offset;
loff_t ret;
- /* Nothing to be found beyond the end of the file. */
- if (offset >= size)
+ /* Nothing to be found before or beyond the end of the file. */
+ if (offset < 0 || offset >= size)
return -ENXIO;
while (length > 0) {
@@ -656,8 +656,8 @@ iomap_seek_data(struct inode *inode, loff_t offset, const struct iomap_ops *ops)
loff_t length = size - offset;
loff_t ret;
- /* Nothing to be found beyond the end of the file. */
- if (offset >= size)
+ /* Nothing to be found before or beyond the end of the file. */
+ if (offset < 0 || offset >= size)
return -ENXIO;
while (length > 0) {