]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
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)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 21 Apr 2017 08:11:59 +0000 (10:11 +0200)
commita4b79d9c9df74956a1228daded86b21732ef77bb
treeb88ae1a889d3fad50448a0d6151f5870a190808b
parentef8e09b53b053f6e6a6a40e283f011b72baf0652
staging: android: ashmem: lseek failed due to no FMODE_LSEEK.

BugLink: http://bugs.launchpad.net/bugs/1682130
commit 97fbfef6bd597888485b653175fb846c6998b60c upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/staging/android/ashmem.c