]> git.baikalelectronics.ru Git - kernel.git/commit
fs: allow no_seek_end_llseek to actually seek
authorWouter van Kesteren <woutershep@gmail.com>
Tue, 16 Feb 2016 21:20:59 +0000 (22:20 +0100)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 20 Feb 2016 05:15:50 +0000 (00:15 -0500)
commitcc75db45d8a10b7bdd1313f47ba767c0b3ae0cda
tree44b6c6e9b75c40dace87ea10956ad2b692449fe5
parent6f7ac95c87b62c01cc6bd12f75e64f8ab4e5f28b
fs: allow no_seek_end_llseek to actually seek

The user-visible impact of the issue is for example that without this
patch sensors-detect breaks when trying to seek in /dev/cpu/0/cpuid.

'~0ULL' is a 'unsigned long long' that when converted to a loff_t,
which is signed, gets turned into -1. later in vfs_setpos we have
'if (offset > maxsize)', which makes it always return EINVAL.

Fixes: 6b7d5f291224 ("new helpers: no_seek_end_llseek{,_size}()")
Signed-off-by: Wouter van Kesteren <woutershep@gmail.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/read_write.c