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-Tag: khadas-vims-v0.9.6-release~1584^2~788 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b8b8c5af351e0ad239ccaf314a4856b4c9f786c4;p=platform%2Fkernel%2Flinux-amlogic.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 (cherry picked from commit 6c8d409129bbebe36cde9f8e511011756216163a) Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c index 3a52b29..9435dc5 100644 --- a/drivers/staging/android/ashmem.c +++ b/drivers/staging/android/ashmem.c @@ -405,6 +405,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);