Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935231AbdDFOak (ORCPT ); Thu, 6 Apr 2017 10:30:40 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:35408 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935049AbdDFOag (ORCPT ); Thu, 6 Apr 2017 10:30:36 -0400 From: zhangshuxiaomi@gmail.com To: gregkh@linuxfoundation.org Cc: ghackmann@google.com, arve@android.com, riandrews@android.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, zhangshuxiao Subject: [PATCH] staging: android: ashmem: lseek failed due to no FMODE_LSEEK. Date: Thu, 6 Apr 2017 22:30:29 +0800 Message-Id: <1491489029-11052-1-git-send-email-zhangshuxiaomi@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 788 Lines: 26 From: zhangshuxiao 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. Signed-off-by: Shuxiao Zhang Tested-by: Greg Hackmann --- drivers/staging/android/ashmem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c index 3f11332..e4530ac 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); -- 1.9.1