Skip to content

Commit fa883d6

Browse files
committed
Merge tag 'for-linus-2020-03-07' of gitolite.kernel.org:pub/scm/linux/kernel/git/brauner/linux
Pull thread fixes from Christian Brauner: "Here are a few hopefully uncontroversial fixes: - Use RCU_INIT_POINTER() when initializing rcu protected members in task_struct to fix sparse warnings. - Add pidfd_fdinfo_test binary to .gitignore file" * tag 'for-linus-2020-03-07' of gitolite.kernel.org:pub/scm/linux/kernel/git/brauner/linux: selftests: pidfd: Add pidfd_fdinfo_test in .gitignore exit: Fix Sparse errors and warnings fork: Use RCU_INIT_POINTER() instead of rcu_access_pointer()
2 parents 676fc8d + 186e28a commit fa883d6

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

kernel/exit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,8 +619,8 @@ static void forget_original_parent(struct task_struct *father,
619619
reaper = find_new_reaper(father, reaper);
620620
list_for_each_entry(p, &father->children, sibling) {
621621
for_each_thread(p, t) {
622-
t->real_parent = reaper;
623-
BUG_ON((!t->ptrace) != (t->parent == father));
622+
RCU_INIT_POINTER(t->real_parent, reaper);
623+
BUG_ON((!t->ptrace) != (rcu_access_pointer(t->parent) == father));
624624
if (likely(!t->ptrace))
625625
t->parent = t->real_parent;
626626
if (t->pdeath_signal)

kernel/fork.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1508,7 +1508,7 @@ static int copy_sighand(unsigned long clone_flags, struct task_struct *tsk)
15081508
return 0;
15091509
}
15101510
sig = kmem_cache_alloc(sighand_cachep, GFP_KERNEL);
1511-
rcu_assign_pointer(tsk->sighand, sig);
1511+
RCU_INIT_POINTER(tsk->sighand, sig);
15121512
if (!sig)
15131513
return -ENOMEM;
15141514

tools/testing/selftests/pidfd/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ pidfd_open_test
22
pidfd_poll_test
33
pidfd_test
44
pidfd_wait
5+
pidfd_fdinfo_test
56
pidfd_getfd_test

0 commit comments

Comments
 (0)