OSDN Git Service

staging: android: ashmem: lseek failed due to no FMODE_LSEEK.
authorzhangshuxiao <zhangshuxiao@xiaomi.com>
Wed, 8 Mar 2017 08:53:24 +0000 (16:53 +0800)
committerGreg Kroah-Hartman <gregkh@google.com>
Mon, 10 Apr 2017 14:07:10 +0000 (14:07 +0000)
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.

Change-Id: Ia78ef4c7c96adb89d52e70b63f7c00636fe60d01
Signed-off-by: zhangshuxiao <zhangshuxiao@xiaomi.com>
drivers/staging/android/ashmem.c

index 3f11332..e4530ac 100644 (file)
@@ -392,6 +392,7 @@ static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
                        ret = PTR_ERR(vmfile);
                        goto out;
                }
+               vmfile->f_mode |= FMODE_LSEEK;
                asma->file = vmfile;
        }
        get_file(asma->file);