Skip to content

Commit 193b590

Browse files
Shuxiao Zhanggregkh
authored andcommitted
staging: android: ashmem: lseek failed due to no FMODE_LSEEK.
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. 91360b0 ("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: 91360b0 ("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>
1 parent 69d8d58 commit 193b590

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/staging/android/ashmem.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
392392
ret = PTR_ERR(vmfile);
393393
goto out;
394394
}
395+
vmfile->f_mode |= FMODE_LSEEK;
395396
asma->file = vmfile;
396397
}
397398
get_file(asma->file);

0 commit comments

Comments
 (0)