* [PATCH] staging: android: ashmem: lseek failed due to no FMODE_LSEEK.
@ 2017-04-06 14:30 zhangshuxiaomi
2017-04-06 15:30 ` Greg Hackmann
0 siblings, 1 reply; 7+ messages in thread
From: zhangshuxiaomi @ 2017-04-06 14:30 UTC (permalink / raw)
To: gregkh; +Cc: ghackmann, arve, riandrews, devel, linux-kernel, zhangshuxiao
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);
--
1.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] staging: android: ashmem: lseek failed due to no FMODE_LSEEK.
2017-04-06 14:30 [PATCH] staging: android: ashmem: lseek failed due to no FMODE_LSEEK zhangshuxiaomi
@ 2017-04-06 15:30 ` Greg Hackmann
2017-04-06 17:08 ` Greg KH
0 siblings, 1 reply; 7+ messages in thread
From: Greg Hackmann @ 2017-04-06 15:30 UTC (permalink / raw)
To: zhangshuxiaomi, gregkh; +Cc: arve, riandrews, devel, linux-kernel, zhangshuxiao
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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] staging: android: ashmem: lseek failed due to no FMODE_LSEEK.
2017-04-06 15:30 ` Greg Hackmann
@ 2017-04-06 17:08 ` Greg KH
2017-04-06 17:25 ` Greg Hackmann
0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2017-04-06 17:08 UTC (permalink / raw)
To: Greg Hackmann
Cc: zhangshuxiaomi, arve, riandrews, devel, linux-kernel, zhangshuxiao
On Thu, Apr 06, 2017 at 08:30:40AM -0700, Greg Hackmann wrote:
> 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.
Thanks for letting me know, I'll update the changelog a bit. How far
back does this patch need to go in stable kernel releases?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] staging: android: ashmem: lseek failed due to no FMODE_LSEEK.
2017-04-06 17:08 ` Greg KH
@ 2017-04-06 17:25 ` Greg Hackmann
0 siblings, 0 replies; 7+ messages in thread
From: Greg Hackmann @ 2017-04-06 17:25 UTC (permalink / raw)
To: Greg KH
Cc: zhangshuxiaomi, arve, riandrews, devel, linux-kernel, zhangshuxiao
On 04/06/2017 10:08 AM, Greg KH wrote:
> On Thu, Apr 06, 2017 at 08:30:40AM -0700, Greg Hackmann wrote:
>> 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.
>
> Thanks for letting me know, I'll update the changelog a bit. How far
> back does this patch need to go in stable kernel releases?
>
> thanks,
>
> greg k-h
>
3.18 and later.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] staging: android: ashmem: lseek failed due to no FMODE_LSEEK.
2017-03-08 10:18 zhangshuxiaomi
@ 2017-03-09 12:38 ` Greg KH
0 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2017-03-09 12:38 UTC (permalink / raw)
To: zhangshuxiaomi; +Cc: arve, riandrews, devel, linux-kernel, zhangshuxiao
On Wed, Mar 08, 2017 at 06:18:32PM +0800, 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.
Really? What is causing this failure? I haven't heard from anyone else
about this issue, is there something different in your userspace
framework?
>
> Signed-off-by: zhangshuxiao <zhangshuxiao@xiaomi.com>
I need a "full" name for a signed-off-by: please.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] staging: android: ashmem: lseek failed due to no FMODE_LSEEK.
@ 2017-03-08 10:18 zhangshuxiaomi
2017-03-09 12:38 ` Greg KH
0 siblings, 1 reply; 7+ messages in thread
From: zhangshuxiaomi @ 2017-03-08 10:18 UTC (permalink / raw)
To: gregkh, arve, riandrews, devel, linux-kernel; +Cc: zhangshuxiao
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: zhangshuxiao <zhangshuxiao@xiaomi.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);
--
1.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] staging: android: ashmem: lseek failed due to no FMODE_LSEEK.
@ 2017-03-08 10:11 zhangshuxiaomi
0 siblings, 0 replies; 7+ messages in thread
From: zhangshuxiaomi @ 2017-03-08 10:11 UTC (permalink / raw)
To: gregkh, devel, linux-kernel; +Cc: zhangshuxiao
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: zhangshuxiao <zhangshuxiao@xiaomi.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);
--
1.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-04-06 17:25 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-06 14:30 [PATCH] staging: android: ashmem: lseek failed due to no FMODE_LSEEK zhangshuxiaomi
2017-04-06 15:30 ` Greg Hackmann
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).