All of lore.kernel.org
 help / color / mirror / Atom feed
* epoll_create(0) becomes not to fail (Re: issue with epoll system  call)
@ 2009-05-08  7:49 Hiroyuki Machida
  2009-05-08 15:19 ` Davide Libenzi
  2009-05-12  6:54 ` rohit verma
  0 siblings, 2 replies; 5+ messages in thread
From: Hiroyuki Machida @ 2009-05-08  7:49 UTC (permalink / raw)
  To: rohit verma; +Cc: linux-kernel

Hi  Verma,

I think your point is right. but descriptions looks not straight forward.
And title of the message is very confusable.
I think descriptions like following would be easy to understand, and
you should attach a your signed-off patch to fix the bug.


Thanks,
Hiro

----

The following patch changed behavior of epoll_create(0);

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=9fe5ad9c8cef9ad5873d8ee55d1cf00d9b607df0;hp=e38b36f325153eaadd1c2a7abc5762079233e540


Before applying the patch,
sys_epoll_create2(int size, int flags)
returned -EINVAL,  with size=0;

But,  if-condtion which is introduced in sys_epoll_create() by this patch,
looks to fail to consider case of size==0 as follows;

 asmlinkage long sys_epoll_create(int size)
 {
-       return sys_epoll_create2(size, 0);
+       if (size < 0)
+               return -EINVAL;
+
+       return sys_epoll_create1(0);
 }


---
Hiroyuki Machida



On Thu, May 7, 2009 at 4:10 PM, rohit verma <rohit.170309@gmail.com> wrote:
> hi all,
>
> The man pages of epoll_create says - "Since Linux 2.6.8, the size
> argument is unused.  (The kernel dynamically sizes the required data
> structures without needing this initial hint.)" .
>
> Also, it says that the syscall returns EINVAL , when size is not
> positive. (i.e For, any value greater than 0, the kernel dynamically
> sizes the required data stuctures). When size is zero or less than
> zero, it has to return with error as EINVAL.
>
> the link:  http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=9fe5ad9c8cef9ad5873d8ee55d1cf00d9b607df0;hp=e38b36f325153eaadd1c2a7abc5762079233e540
>
> shows the latest patch of the epoll syscall. here , the syscall says:
>
> asmlinkage long sys_epoll_create(int size)
> {
> - return sys_epoll_create2(size,0);
> + if (size < 0)
> +  return -EINVAL;
> +
> +return sys_epoll_create1(0);
> }
>
> So if size = 0, it returns success which might not be the expected
> result. So i feel that the condition check should be
> " if (size <= 0) ". could u please check on this and reply me..
>
> Thank you,
>
> Regards,
> rohit
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: epoll_create(0) becomes not to fail (Re: issue with epoll system call)
  2009-05-08  7:49 epoll_create(0) becomes not to fail (Re: issue with epoll system call) Hiroyuki Machida
@ 2009-05-08 15:19 ` Davide Libenzi
  2009-05-12  6:54 ` rohit verma
  1 sibling, 0 replies; 5+ messages in thread
From: Davide Libenzi @ 2009-05-08 15:19 UTC (permalink / raw)
  To: Hiroyuki Machida; +Cc: rohit verma, Andrew Morton, Linux Kernel Mailing List

On Fri, 8 May 2009, Hiroyuki Machida wrote:

> Hi  Verma,
> 
> I think your point is right. but descriptions looks not straight forward.
> And title of the message is very confusable.
> I think descriptions like following would be easy to understand, and
> you should attach a your signed-off patch to fix the bug.

Thanks, will take care of it. Unless you want to do me a favour and post a 
properly formatted patch that I can ACK. Both the ones I've seen do not 
fit the bill.


- Davide



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: epoll_create(0) becomes not to fail (Re: issue with epoll system  call)
  2009-05-08  7:49 epoll_create(0) becomes not to fail (Re: issue with epoll system call) Hiroyuki Machida
  2009-05-08 15:19 ` Davide Libenzi
@ 2009-05-12  6:54 ` rohit verma
  2009-05-12 19:03   ` Davide Libenzi
  2009-05-13  0:58   ` Hiroyuki Machida
  1 sibling, 2 replies; 5+ messages in thread
From: rohit verma @ 2009-05-12  6:54 UTC (permalink / raw)
  To: Hiroyuki.Mach; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 3284 bytes --]

hi,

I have created a patch for epoll_create syscall as shown below. Plz
have a check and
get back to me.

diff a/fs/eventpoll.c   b/fs/eventpoll.c



--- eventpoll_orig.c    2009-05-12 12:07:27.000000000 +0530
+++ eventpoll.c 2009-05-12 12:10:14.000000000 +0530
@@ -1136,7 +1136,7 @@
 SYSCALL_DEFINE1(epoll_create, int, size)
 {
-       if (size < 0)
+       if (size <= 0)
                return -EINVAL;
        return sys_epoll_create1(0);



Since there might be some formatting problems, i'm also attaching the
patch in this
mail.

Regards,
Rohit



On Fri, May 8, 2009 at 1:19 PM, Hiroyuki Machida
<Hiroyuki.Mach@gmail.com> wrote:
>
> Hi  Verma,
>
> I think your point is right. but descriptions looks not straight forward.
> And title of the message is very confusable.
> I think descriptions like following would be easy to understand, and
> you should attach a your signed-off patch to fix the bug.
>
>
> Thanks,
> Hiro
>
> ----
>
> The following patch changed behavior of epoll_create(0);
>
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=9fe5ad9c8cef9ad5873d8ee55d1cf00d9b607df0;hp=e38b36f325153eaadd1c2a7abc5762079233e540
>
>
> Before applying the patch,
> sys_epoll_create2(int size, int flags)
> returned -EINVAL,  with size=0;
>
> But,  if-condtion which is introduced in sys_epoll_create() by this patch,
> looks to fail to consider case of size==0 as follows;
>
>  asmlinkage long sys_epoll_create(int size)
>  {
> -       return sys_epoll_create2(size, 0);
> +       if (size < 0)
> +               return -EINVAL;
> +
> +       return sys_epoll_create1(0);
>  }
>
>
> ---
> Hiroyuki Machida
>
>
>
> On Thu, May 7, 2009 at 4:10 PM, rohit verma <rohit.170309@gmail.com> wrote:
> > hi all,
> >
> > The man pages of epoll_create says - "Since Linux 2.6.8, the size
> > argument is unused.  (The kernel dynamically sizes the required data
> > structures without needing this initial hint.)" .
> >
> > Also, it says that the syscall returns EINVAL , when size is not
> > positive. (i.e For, any value greater than 0, the kernel dynamically
> > sizes the required data stuctures). When size is zero or less than
> > zero, it has to return with error as EINVAL.
> >
> > the link:  http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=9fe5ad9c8cef9ad5873d8ee55d1cf00d9b607df0;hp=e38b36f325153eaadd1c2a7abc5762079233e540
> >
> > shows the latest patch of the epoll syscall. here , the syscall says:
> >
> > asmlinkage long sys_epoll_create(int size)
> > {
> > - return sys_epoll_create2(size,0);
> > + if (size < 0)
> > +  return -EINVAL;
> > +
> > +return sys_epoll_create1(0);
> > }
> >
> > So if size = 0, it returns success which might not be the expected
> > result. So i feel that the condition check should be
> > " if (size <= 0) ". could u please check on this and reply me..
> >
> > Thank you,
> >
> > Regards,
> > rohit
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at  http://www.tux.org/lkml/
> >

[-- Attachment #2: epoll.patch --]
[-- Type: application/octet-stream, Size: 263 bytes --]

--- eventpoll_orig.c	2009-05-12 12:07:27.000000000 +0530
+++ eventpoll.c	2009-05-12 12:10:14.000000000 +0530
@@ -1136,7 +1136,7 @@
 
 SYSCALL_DEFINE1(epoll_create, int, size)
 {
-	if (size < 0)
+	if (size <= 0)
 		return -EINVAL;
 
 	return sys_epoll_create1(0);

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: epoll_create(0) becomes not to fail (Re: issue with epoll system call)
  2009-05-12  6:54 ` rohit verma
@ 2009-05-12 19:03   ` Davide Libenzi
  2009-05-13  0:58   ` Hiroyuki Machida
  1 sibling, 0 replies; 5+ messages in thread
From: Davide Libenzi @ 2009-05-12 19:03 UTC (permalink / raw)
  To: rohit verma; +Cc: Hiroyuki.Mach, Linux Kernel Mailing List

[-- Attachment #1: Type: TEXT/PLAIN, Size: 3492 bytes --]

On Tue, 12 May 2009, rohit verma wrote:

> hi,
> 
> I have created a patch for epoll_create syscall as shown below. Plz
> have a check and
> get back to me.

Never mind. I'll submit myself ..




> 
> diff a/fs/eventpoll.c   b/fs/eventpoll.c
> 
> 
> 
> --- eventpoll_orig.c    2009-05-12 12:07:27.000000000 +0530
> +++ eventpoll.c 2009-05-12 12:10:14.000000000 +0530
> @@ -1136,7 +1136,7 @@
>  SYSCALL_DEFINE1(epoll_create, int, size)
>  {
> -       if (size < 0)
> +       if (size <= 0)
>                 return -EINVAL;
>         return sys_epoll_create1(0);
> 
> 
> 
> Since there might be some formatting problems, i'm also attaching the
> patch in this
> mail.
> 
> Regards,
> Rohit
> 
> 
> 
> On Fri, May 8, 2009 at 1:19 PM, Hiroyuki Machida
> <Hiroyuki.Mach@gmail.com> wrote:
> >
> > Hi  Verma,
> >
> > I think your point is right. but descriptions looks not straight forward.
> > And title of the message is very confusable.
> > I think descriptions like following would be easy to understand, and
> > you should attach a your signed-off patch to fix the bug.
> >
> >
> > Thanks,
> > Hiro
> >
> > ----
> >
> > The following patch changed behavior of epoll_create(0);
> >
> > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=9fe5ad9c8cef9ad5873d8ee55d1cf00d9b607df0;hp=e38b36f325153eaadd1c2a7abc5762079233e540
> >
> >
> > Before applying the patch,
> > sys_epoll_create2(int size, int flags)
> > returned -EINVAL,  with size=0;
> >
> > But,  if-condtion which is introduced in sys_epoll_create() by this patch,
> > looks to fail to consider case of size==0 as follows;
> >
> >  asmlinkage long sys_epoll_create(int size)
> >  {
> > -       return sys_epoll_create2(size, 0);
> > +       if (size < 0)
> > +               return -EINVAL;
> > +
> > +       return sys_epoll_create1(0);
> >  }
> >
> >
> > ---
> > Hiroyuki Machida
> >
> >
> >
> > On Thu, May 7, 2009 at 4:10 PM, rohit verma <rohit.170309@gmail.com> wrote:
> > > hi all,
> > >
> > > The man pages of epoll_create says - "Since Linux 2.6.8, the size
> > > argument is unused.  (The kernel dynamically sizes the required data
> > > structures without needing this initial hint.)" .
> > >
> > > Also, it says that the syscall returns EINVAL , when size is not
> > > positive. (i.e For, any value greater than 0, the kernel dynamically
> > > sizes the required data stuctures). When size is zero or less than
> > > zero, it has to return with error as EINVAL.
> > >
> > > the link:  http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=9fe5ad9c8cef9ad5873d8ee55d1cf00d9b607df0;hp=e38b36f325153eaadd1c2a7abc5762079233e540
> > >
> > > shows the latest patch of the epoll syscall. here , the syscall says:
> > >
> > > asmlinkage long sys_epoll_create(int size)
> > > {
> > > - return sys_epoll_create2(size,0);
> > > + if (size < 0)
> > > +  return -EINVAL;
> > > +
> > > +return sys_epoll_create1(0);
> > > }
> > >
> > > So if size = 0, it returns success which might not be the expected
> > > result. So i feel that the condition check should be
> > > " if (size <= 0) ". could u please check on this and reply me..
> > >
> > > Thank you,
> > >
> > > Regards,
> > > rohit
> > > --
> > > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > > the body of a message to majordomo@vger.kernel.org
> > > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > > Please read the FAQ at  http://www.tux.org/lkml/
> > >
> 


- Davide


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: epoll_create(0) becomes not to fail (Re: issue with epoll system  call)
  2009-05-12  6:54 ` rohit verma
  2009-05-12 19:03   ` Davide Libenzi
@ 2009-05-13  0:58   ` Hiroyuki Machida
  1 sibling, 0 replies; 5+ messages in thread
From: Hiroyuki Machida @ 2009-05-13  0:58 UTC (permalink / raw)
  To: rohit verma; +Cc: linux-kernel

Hi
I think it's better to read, before submitting report/patch

http://kernelnewbies.org/FoundBug
http://kernelnewbies.org/UpstreamMerge/SubmittingPatches

----
Hiroyuki Machida



On Tue, May 12, 2009 at 3:54 PM, rohit verma <rohit.170309@gmail.com> wrote:
> hi,
>
> I have created a patch for epoll_create syscall as shown below. Plz
> have a check and
> get back to me.
>
> diff a/fs/eventpoll.c   b/fs/eventpoll.c
>
>
>
> --- eventpoll_orig.c    2009-05-12 12:07:27.000000000 +0530
> +++ eventpoll.c 2009-05-12 12:10:14.000000000 +0530
> @@ -1136,7 +1136,7 @@
>  SYSCALL_DEFINE1(epoll_create, int, size)
>  {
> -       if (size < 0)
> +       if (size <= 0)
>                 return -EINVAL;
>         return sys_epoll_create1(0);
>
>
>
> Since there might be some formatting problems, i'm also attaching the
> patch in this
> mail.
>
> Regards,
> Rohit
>
>
>
> On Fri, May 8, 2009 at 1:19 PM, Hiroyuki Machida
> <Hiroyuki.Mach@gmail.com> wrote:
>>
>> Hi  Verma,
>>
>> I think your point is right. but descriptions looks not straight forward.
>> And title of the message is very confusable.
>> I think descriptions like following would be easy to understand, and
>> you should attach a your signed-off patch to fix the bug.
>>
>>
>> Thanks,
>> Hiro
>>
>> ----
>>
>> The following patch changed behavior of epoll_create(0);
>>
>> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=9fe5ad9c8cef9ad5873d8ee55d1cf00d9b607df0;hp=e38b36f325153eaadd1c2a7abc5762079233e540
>>
>>
>> Before applying the patch,
>> sys_epoll_create2(int size, int flags)
>> returned -EINVAL,  with size=0;
>>
>> But,  if-condtion which is introduced in sys_epoll_create() by this patch,
>> looks to fail to consider case of size==0 as follows;
>>
>>  asmlinkage long sys_epoll_create(int size)
>>  {
>> -       return sys_epoll_create2(size, 0);
>> +       if (size < 0)
>> +               return -EINVAL;
>> +
>> +       return sys_epoll_create1(0);
>>  }
>>
>>
>> ---
>> Hiroyuki Machida
>>
>>
>>
>> On Thu, May 7, 2009 at 4:10 PM, rohit verma <rohit.170309@gmail.com> wrote:
>> > hi all,
>> >
>> > The man pages of epoll_create says - "Since Linux 2.6.8, the size
>> > argument is unused.  (The kernel dynamically sizes the required data
>> > structures without needing this initial hint.)" .
>> >
>> > Also, it says that the syscall returns EINVAL , when size is not
>> > positive. (i.e For, any value greater than 0, the kernel dynamically
>> > sizes the required data stuctures). When size is zero or less than
>> > zero, it has to return with error as EINVAL.
>> >
>> > the link:  http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=9fe5ad9c8cef9ad5873d8ee55d1cf00d9b607df0;hp=e38b36f325153eaadd1c2a7abc5762079233e540
>> >
>> > shows the latest patch of the epoll syscall. here , the syscall says:
>> >
>> > asmlinkage long sys_epoll_create(int size)
>> > {
>> > - return sys_epoll_create2(size,0);
>> > + if (size < 0)
>> > +  return -EINVAL;
>> > +
>> > +return sys_epoll_create1(0);
>> > }
>> >
>> > So if size = 0, it returns success which might not be the expected
>> > result. So i feel that the condition check should be
>> > " if (size <= 0) ". could u please check on this and reply me..
>> >
>> > Thank you,
>> >
>> > Regards,
>> > rohit
>> > --
>> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> > the body of a message to majordomo@vger.kernel.org
>> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> > Please read the FAQ at  http://www.tux.org/lkml/
>> >
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-05-13  0:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-08  7:49 epoll_create(0) becomes not to fail (Re: issue with epoll system call) Hiroyuki Machida
2009-05-08 15:19 ` Davide Libenzi
2009-05-12  6:54 ` rohit verma
2009-05-12 19:03   ` Davide Libenzi
2009-05-13  0:58   ` Hiroyuki Machida

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.