vfs: Return -ENXIO for negative SEEK_HOLE / SEEK_DATA offsets
authorAndreas Gruenbacher <agruenba@redhat.com>
Mon, 25 Sep 2017 10:23:03 +0000 (12:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Oct 2017 07:44:01 +0000 (09:44 +0200)
commitf3e2e7f0b4d77d8b26a2bd5525c35d9a16952517
treed6780ca6d6204c052d79333ba5da5aac6882f0eb
parent18a89a10b26b325da5eb03cbd275f835a4a704f5
vfs: Return -ENXIO for negative SEEK_HOLE / SEEK_DATA offsets

commit fc46820b27a2d9a46f7e90c9ceb4a64a1bc5fab8 upstream.

In generic_file_llseek_size, return -ENXIO for negative offsets as well
as offsets beyond EOF.  This affects filesystems which don't implement
SEEK_HOLE / SEEK_DATA internally, possibly because they don't support
holes.

Fixes xfstest generic/448.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/read_write.c