提交 dd98acf7 编写于 作者: O Oleg Nesterov 提交者: Linus Torvalds

keyctl_session_to_parent(): use thread_group_empty() to check singlethreadness

No functional changes.

keyctl_session_to_parent() is the only user of signal->count which needs
the correct value.  Change it to use thread_group_empty() instead, this
must be strictly equivalent under tasklist, and imho looks better.
Signed-off-by: NOleg Nesterov <oleg@redhat.com>
Acked-by: NDavid Howells <dhowells@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Acked-by: NRoland McGrath <roland@redhat.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 5089a976
...@@ -1269,7 +1269,7 @@ long keyctl_session_to_parent(void) ...@@ -1269,7 +1269,7 @@ long keyctl_session_to_parent(void)
goto not_permitted; goto not_permitted;
/* the parent must be single threaded */ /* the parent must be single threaded */
if (atomic_read(&parent->signal->count) != 1) if (!thread_group_empty(parent))
goto not_permitted; goto not_permitted;
/* the parent and the child must have different session keyrings or /* the parent and the child must have different session keyrings or
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册