From: Greg Hackmann <ghackmann@google.com>
To: zhangshuxiaomi@gmail.com, gregkh@linuxfoundation.org
Cc: arve@android.com, riandrews@android.com,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
zhangshuxiao <zhangshuxiao@xiaomi.com>
Subject: Re: [PATCH] staging: android: ashmem: lseek failed due to no FMODE_LSEEK.
Date: Thu, 6 Apr 2017 08:30:40 -0700 [thread overview]
Message-ID: <94155867-d589-6451-2f3b-a960df559702@google.com> (raw)
In-Reply-To: <1491489029-11052-1-git-send-email-zhangshuxiaomi@gmail.com>
On 04/06/2017 07:30 AM, zhangshuxiaomi@gmail.com wrote:
> From: zhangshuxiao <zhangshuxiao@xiaomi.com>
>
> 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 <zhangshuxiao@xiaomi.com>
> Tested-by: Greg Hackmann <ghackmann@google.com>
> ---
> 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);
>
This commit message is missing some important context.
ashmem_llseek() passes the llseek() call through to the backing shmem
file. 91360b02ab48 ("ashmem: use vfs_llseek()") changed this from
directly calling the file's llseek() op into a VFS layer call. This
also adds a check for the FMODE_LSEEK bit, so without that bit
ashmem_llseek() now always fails with -ESPIPE.
I've tested that this patch fixes the regression on both hikey running
AOSP and User Mode Linux running Debian.
next prev parent reply other threads:[~2017-04-06 15:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-06 14:30 zhangshuxiaomi
2017-04-06 15:30 ` Greg Hackmann [this message]
2017-04-06 17:08 ` Greg KH
2017-04-06 17:25 ` Greg Hackmann
-- strict thread matches above, loose matches on Subject: below --
2017-03-08 10:18 zhangshuxiaomi
2017-03-09 12:38 ` Greg KH
2017-03-08 10:11 zhangshuxiaomi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=94155867-d589-6451-2f3b-a960df559702@google.com \
--to=ghackmann@google.com \
--cc=arve@android.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=riandrews@android.com \
--cc=zhangshuxiao@xiaomi.com \
--cc=zhangshuxiaomi@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®