staging: android: ashmem: lseek failed due to no FMODE_LSEEK.
authorShuxiao Zhang <zhangshuxiao@xiaomi.com>
Thu, 6 Apr 2017 14:30:29 +0000 (22:30 +0800)
committerSasha Levin <alexander.levin@verizon.com>
Wed, 17 May 2017 19:08:21 +0000 (15:08 -0400)
commitdad2a28d46e7568849778dbc838545c0daf70df5
tree83f4dfd93c2833d0c0652c6d596449710bdbe958
parent4ac302f8832f476ed75b10ff2628d87a78e0e575
staging: android: ashmem: lseek failed due to no FMODE_LSEEK.

[ Upstream commit 97fbfef6bd597888485b653175fb846c6998b60c ]

vfs_llseek will check whether the file mode has
FMODE_LSEEK, no return failure. But ashmem can be
lseek, so add FMODE_LSEEK to ashmem file.

Comment From Greg Hackmann:
ashmem_llseek() passes the llseek() call through to the backing
shmem file.  91360b02ab48 ("ashmem: use vfs_llseek()") changed
this from directly calling the file's llseek() op into a VFS
layer call.  This also adds a check for the FMODE_LSEEK bit, so
without that bit ashmem_llseek() now always fails with -ESPIPE.

Fixes: 91360b02ab48 ("ashmem: use vfs_llseek()")
Signed-off-by: Shuxiao Zhang <zhangshuxiao@xiaomi.com>
Tested-by: Greg Hackmann <ghackmann@google.com>
Cc: stable <stable@vger.kernel.org> # 3.18+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
drivers/staging/android/ashmem.c