2.6.5-rc2 __WAITQUEUE_INITIALIZER
PATCH 1/1 2.6.5-rc2 __WAITQUEUE_INITIALIZER
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
include/linux/wait.h Mon, 29 Mar 2004 15:36:39 +1000 kaos (linux-2.6/m/c/34_wait.h 1.1 644) renamed from include/linux/wait.h Thu, 18 Dec 2003 16:46:13 +1100 kaos (linux-2.6/m/c/34_wait.h 1.1 644) +1 -0
@@ -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 } }
Quoted 8 lines · Keith Owens
When struct
__wait_queueis on stack or you reuse an existing waitqueue, you get garbage in the flags.Index:
5-rc2.1/include/linux/wait.h
include/linux/wait.h Mon, 29 Mar 2004 15:36:39 +1000 kaos (linux-2.6/m/c/34_wait.h 1.1 644) typedef struct __wait_queue_head wait_qu · line 46
Quoted 7 lines
include/linux/wait.h Mon, 29 Mar 2004 15:36:39 +1000 kaos (linux-2.6/m/c/34_wait.h 1.1 644) renamed from include/linux/wait.h Thu, 18 Dec 2003 16:46:13 +1100 kaos (linux-2.6/m/c/34_wait.h 1.1 644) +1
-0@@ -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?
Quoted 11 lines · Andrew Morton
Quoted 10 lines · Keith Owens
When struct
__wait_queueis on stack or you reuse an existing waitqueue, you get garbage in the flags.Index:
5-rc2.1/include/linux/wait.hinclude/linux/wait.h Mon, 29 Mar 2004 15:36:39 +1000 kaos (linux-2.6/m/c/34_wait.h 1.1 644) renamed from include/linux/wait.h Thu, 18 Dec 2003 16:46:13 +1100 kaos (linux-2.6/m/c/34_wait.h 1.1 644) +0
-0@@ -40,6 +40,7 @@ typedef struct __wait_queue_head wait_qu */
Quoted 7 lines
include/linux/wait.h Mon, 29 Mar 2004 15:36:39 +1000 kaos (linux-2.6/m/c/34_wait.h 1.1 644) typedef struct __wait_queue_head wait_qu · line 46
Quoted 5 lines
include/linux/wait.h Mon, 29 Mar 2004 15:36:39 +1000 kaos (linux-2.6/m/c/34_wait.h 1.1 644) renamed from include/linux/wait.h Thu, 18 Dec 2003 16:46:13 +1100 kaos (linux-2.6/m/c/34_wait.h 1.1 644) +1
-0#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.
Quoted 9 lines
Quoted 9 lines
When struct
__wait_queueis on stack or you reuse an existing waitqueue, you get garbage in the flags.Index:
5-rc2.1/include/linux/wait.hinclude/linux/wait.h Mon, 29 Mar 2004 15:36:39 +1000 kaos (linux-2.6/m/c/34_wait.h 1.1 644) renamed from include/linux/wait.h Thu, 18 Dec 2003 16:46:13 +1100 kaos (linux-2.6/m/c/34_wait.h 1.1 644) +0
-0@@ -40,6 +40,7 @@ typedef struct __wait_queue_head wait_qu */
Quoted 7 lines
include/linux/wait.h Mon, 29 Mar 2004 15:36:39 +1000 kaos (linux-2.6/m/c/34_wait.h 1.1 644) typedef struct __wait_queue_head wait_qu · line 46
Quoted 5 lines
include/linux/wait.h Mon, 29 Mar 2004 15:36:39 +1000 kaos (linux-2.6/m/c/34_wait.h 1.1 644) renamed from include/linux/wait.h Thu, 18 Dec 2003 16:46:13 +1100 kaos (linux-2.6/m/c/34_wait.h 1.1 644) +1
-0#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).
Signature · 1 line
Tomas Szepe <[email protected]>