Skip to content

Commit e3b5a34

Browse files
Tetsuo Handatorvalds
authored andcommitted
include/linux/pid.h: use for_each_thread() in do_each_pid_thread()
while_each_pid_thread() is using while_each_thread(), which is unsafe under RCU lock according to commit 0c740d0 ("introduce for_each_thread() to replace the buggy while_each_thread()"). Use for_each_thread() in do_each_pid_thread() which is safe under RCU lock. Link: http://lkml.kernel.org/r/[email protected] Link: http://lkml.kernel.org/r/1486041779-4401-2-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp Signed-off-by: Tetsuo Handa <[email protected]> Cc: Oleg Nesterov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 369f267 commit e3b5a34

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/linux/pid.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,10 @@ pid_t pid_vnr(struct pid *pid);
191191
#define do_each_pid_thread(pid, type, task) \
192192
do_each_pid_task(pid, type, task) { \
193193
struct task_struct *tg___ = task; \
194-
do {
194+
for_each_thread(tg___, task) {
195195

196196
#define while_each_pid_thread(pid, type, task) \
197-
} while_each_thread(tg___, task); \
197+
} \
198198
task = tg___; \
199199
} while_each_pid_task(pid, type, task)
200200
#endif /* _LINUX_PID_H */

0 commit comments

Comments
 (0)