From: zhangshuxiao Date: Wed, 8 Mar 2017 08:53:24 +0000 (+0800) Subject: staging: android: ashmem: lseek failed due to no FMODE_LSEEK. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=6c8d409129bbebe36cde9f8e511011756216163a;p=sagit-ice-cold%2Fkernel_xiaomi_msm8998.git staging: android: ashmem: lseek failed due to no FMODE_LSEEK. 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 --- diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c index 3f1133230a1a..e4530ac6d5d4 100644 --- a/drivers/staging/android/ashmem.c +++ b/drivers/staging/android/ashmem.c @@ -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);