Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tmpfs: fix SEEK_DATA/SEEK_HOLE regression

Commit 46a1c2c7ae53 ("vfs: export lseek_execute() to modules") broke the
tmpfs SEEK_DATA/SEEK_HOLE implementation, because vfs_setpos() converts
the carefully prepared -ENXIO to -EINVAL. Other filesystems avoid it in
error cases: do the same in tmpfs.

Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: Jie Liu <jeff.liu@oracle.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Hugh Dickins and committed by
Linus Torvalds
387aae6f 2f853991

+2 -1
+2 -1
mm/shmem.c
··· 1798 1798 } 1799 1799 } 1800 1800 1801 - offset = vfs_setpos(file, offset, MAX_LFS_FILESIZE); 1801 + if (offset >= 0) 1802 + offset = vfs_setpos(file, offset, MAX_LFS_FILESIZE); 1802 1803 mutex_unlock(&inode->i_mutex); 1803 1804 return offset; 1804 1805 }