mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch] 2.6.5-rc2 __WAITQUEUE_INITIALIZER
@ 2004-03-29  5:49 Keith Owens
  2004-03-29  6:53 ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Keith Owens @ 2004-03-29  5:49 UTC (permalink / raw)
  To: linux-kernel

When struct __wait_queue is on stack or you reuse an existing
waitqueue, you get garbage in the flags.

Index: 5-rc2.1/include/linux/wait.h
--- 5-rc2.1/include/linux/wait.h Thu, 18 Dec 2003 16:46:13 +1100 kaos (linux-2.6/m/c/34_wait.h 1.1 644)
+++ 5-rc2.1(w)/include/linux/wait.h Mon, 29 Mar 2004 15:36:39 +1000 kaos (linux-2.6/m/c/34_wait.h 1.1 644)
@@ -40,6 +40,7 @@ typedef struct __wait_queue_head wait_qu
  */
 
 #define __WAITQUEUE_INITIALIZER(name, tsk) {				\
+	.flags		= 0,						\
 	.task		= tsk,						\
 	.func		= default_wake_function,			\
 	.task_list	= { NULL, NULL } }


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

* Re: [patch] 2.6.5-rc2 __WAITQUEUE_INITIALIZER
  2004-03-29  5:49 [patch] 2.6.5-rc2 __WAITQUEUE_INITIALIZER Keith Owens
@ 2004-03-29  6:53 ` Andrew Morton
  2004-03-29  8:09   ` Keith Owens
  2004-04-02 13:17   ` Tomas Szepe
  0 siblings, 2 replies; 4+ messages in thread
From: Andrew Morton @ 2004-03-29  6:53 UTC (permalink / raw)
  To: Keith Owens; +Cc: linux-kernel

Keith Owens <kaos@ocs.com.au> wrote:
>
> When struct __wait_queue is on stack or you reuse an existing
> waitqueue, you get garbage in the flags.
> 
> Index: 5-rc2.1/include/linux/wait.h
> --- 5-rc2.1/include/linux/wait.h Thu, 18 Dec 2003 16:46:13 +1100 kaos (linux-2.6/m/c/34_wait.h 1.1 644)
> +++ 5-rc2.1(w)/include/linux/wait.h Mon, 29 Mar 2004 15:36:39 +1000 kaos (linux-2.6/m/c/34_wait.h 1.1 644)
> @@ -40,6 +40,7 @@ typedef struct __wait_queue_head wait_qu
>   */
>  
>  #define __WAITQUEUE_INITIALIZER(name, tsk) {				\
> +	.flags		= 0,						\
>  	.task		= tsk,						\
>  	.func		= default_wake_function,			\
>  	.task_list	= { NULL, NULL } }

The compiler will do this for us?

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

* Re: [patch] 2.6.5-rc2 __WAITQUEUE_INITIALIZER
  2004-03-29  6:53 ` Andrew Morton
@ 2004-03-29  8:09   ` Keith Owens
  2004-04-02 13:17   ` Tomas Szepe
  1 sibling, 0 replies; 4+ messages in thread
From: Keith Owens @ 2004-03-29  8:09 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

On Sun, 28 Mar 2004 22:53:22 -0800, 
Andrew Morton <akpm@osdl.org> wrote:
>Keith Owens <kaos@ocs.com.au> wrote:
>>
>> When struct __wait_queue is on stack or you reuse an existing
>> waitqueue, you get garbage in the flags.
>> 
>> Index: 5-rc2.1/include/linux/wait.h
>> --- 5-rc2.1/include/linux/wait.h Thu, 18 Dec 2003 16:46:13 +1100 kaos (linux-2.6/m/c/34_wait.h 1.1 644)
>> +++ 5-rc2.1(w)/include/linux/wait.h Mon, 29 Mar 2004 15:36:39 +1000 kaos (linux-2.6/m/c/34_wait.h 1.1 644)
>> @@ -40,6 +40,7 @@ typedef struct __wait_queue_head wait_qu
>>   */
>>  
>>  #define __WAITQUEUE_INITIALIZER(name, tsk) {				\
>> +	.flags		= 0,						\
>>  	.task		= tsk,						\
>>  	.func		= default_wake_function,			\
>>  	.task_list	= { NULL, NULL } }
>
>The compiler will do this for us?

I thought I had a test case where the flags were not being set to 0,
but cannot reproduce it.  Ignore this patch unless I get some real
evidence.


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

* Re: [patch] 2.6.5-rc2 __WAITQUEUE_INITIALIZER
  2004-03-29  6:53 ` Andrew Morton
  2004-03-29  8:09   ` Keith Owens
@ 2004-04-02 13:17   ` Tomas Szepe
  1 sibling, 0 replies; 4+ messages in thread
From: Tomas Szepe @ 2004-04-02 13:17 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Keith Owens, linux-kernel

> > When struct __wait_queue is on stack or you reuse an existing
> > waitqueue, you get garbage in the flags.
> > 
> > Index: 5-rc2.1/include/linux/wait.h
> > --- 5-rc2.1/include/linux/wait.h Thu, 18 Dec 2003 16:46:13 +1100 kaos (linux-2.6/m/c/34_wait.h 1.1 644)
> > +++ 5-rc2.1(w)/include/linux/wait.h Mon, 29 Mar 2004 15:36:39 +1000 kaos (linux-2.6/m/c/34_wait.h 1.1 644)
> > @@ -40,6 +40,7 @@ typedef struct __wait_queue_head wait_qu
> >   */
> >  
> >  #define __WAITQUEUE_INITIALIZER(name, tsk) {				\
> > +	.flags		= 0,						\
> >  	.task		= tsk,						\
> >  	.func		= default_wake_function,			\
> >  	.task_list	= { NULL, NULL } }
> 
> The compiler will do this for us?

Yes, but only for statics (I believe).

-- 
Tomas Szepe <szepe@pinerecords.com>

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

end of thread, other threads:[~2004-04-02 13:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-29  5:49 [patch] 2.6.5-rc2 __WAITQUEUE_INITIALIZER Keith Owens
2004-03-29  6:53 ` Andrew Morton
2004-03-29  8:09   ` Keith Owens
2004-04-02 13:17   ` Tomas Szepe

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®