Commit 8a2dca1
syscalls/msgstress01: Fix the stop logic
The stop flag didn't really work because:
- if queue is full msgsnd() will block in the kernel
- if queue is empty msgrcv() will block in the kernel
And if the other process from the reader-writer pair exits the queue
will be never changed and the test will get stuck and killed by watchdog
timer.
What we need to do is to use IPC_NOWAIT, retry manually (after short
usleep) and handle errors manually as well. In that case no processes
will sleep in kernel and setting the stop flag will actually stop the
test.
Link: https://lore.kernel.org/ltp/[email protected]/
Acked-by: Andrea Cervesato <[email protected]>
Reviewed-by: Martin Doucha <[email protected]>
Reviewed-by: Petr Vorel <[email protected]>
Signed-off-by: Cyril Hrubis <[email protected]>1 parent f888bc2 commit 8a2dca1
1 file changed
+22
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
105 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
106 | 116 | | |
107 | 117 | | |
108 | 118 | | |
| |||
115 | 125 | | |
116 | 126 | | |
117 | 127 | | |
118 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
119 | 137 | | |
120 | 138 | | |
121 | 139 | | |
| |||
152 | 170 | | |
153 | 171 | | |
154 | 172 | | |
| 173 | + | |
155 | 174 | | |
156 | 175 | | |
157 | 176 | | |
| |||
0 commit comments