Yufen Yu 1a41364693 tmpfs: make lseek(SEEK_DATA/SEK_HOLE) return ENXIO with a negative offset
Other filesystems such as ext4, f2fs and ubifs all return ENXIO when
lseek (SEEK_DATA or SEEK_HOLE) requests a negative offset.

man 2 lseek says

:      EINVAL whence  is  not  valid.   Or: the resulting file offset would be
:             negative, or beyond the end of a seekable device.
:
:      ENXIO  whence is SEEK_DATA or SEEK_HOLE, and the file offset is  beyond
:             the end of the file.

Make tmpfs return ENXIO under these circumstances as well.  After this,
tmpfs also passes xfstests's generic/448.

[akpm@linux-foundation.org: rewrite changelog]
Link: http://lkml.kernel.org/r/1540434176-14349-1-git-send-email-yuyufen@huawei.com
Signed-off-by: Yufen Yu <yuyufen@huawei.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Hugh Dickins <hughd@google.com>
Cc: William Kucharski <william.kucharski@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-11-18 10:15:10 -08:00
..
2018-10-31 08:54:16 -07:00
2018-10-31 08:54:15 -07:00
2018-10-31 08:54:16 -07:00
2018-10-31 08:54:16 -07:00
2018-10-31 08:54:17 -07:00
2018-09-29 22:47:49 -04:00
2018-06-07 17:34:36 -07:00
2018-10-31 08:54:16 -07:00
2018-10-31 08:54:16 -07:00
2018-11-02 11:25:48 -07:00
2018-11-01 14:42:49 -07:00
2018-10-21 10:46:37 -04:00
2018-10-26 16:26:33 -07:00
2018-10-26 16:26:33 -07:00
2018-11-18 10:15:09 -08:00
2018-02-06 18:32:48 -08:00