Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 387aae6f authored by Hugh Dickins's avatar Hugh Dickins Committed by Linus Torvalds
Browse files

tmpfs: fix SEEK_DATA/SEEK_HOLE regression



Commit 46a1c2c7 ("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: default avatarHugh Dickins <hughd@google.com>
Cc: Jie Liu <jeff.liu@oracle.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2f853991
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1798,6 +1798,7 @@ static loff_t shmem_file_llseek(struct file *file, loff_t offset, int whence)
		}
	}

	if (offset >= 0)
		offset = vfs_setpos(file, offset, MAX_LFS_FILESIZE);
	mutex_unlock(&inode->i_mutex);
	return offset;