Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752802AbdCHLN0 (ORCPT ); Wed, 8 Mar 2017 06:13:26 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:35176 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751755AbdCHLNK (ORCPT ); Wed, 8 Mar 2017 06:13:10 -0500 From: zhangshuxiaomi@gmail.com To: gregkh@suse.de, devel@linuxdriverproject.org, linux-kernel@vger.kernel.org Cc: zhangshuxiao Subject: [PATCH] staging: android: ashmem: lseek failed due to no FMODE_LSEEK. Date: Wed, 8 Mar 2017 18:11:57 +0800 Message-Id: <1488967917-16975-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: 739 Lines: 25 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: zhangshuxiao --- 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