2020-01-27 17:59:42

by Madhuparna Bhowmik

[permalink] [raw]
Subject: [PATCH] fork.c: Use RCU_INIT_POINTER() instead of rcu_access_pointer()

From: Madhuparna Bhowmik <[email protected]>

Use RCU_INIT_POINTER() instead of rcu_access_pointer() in
copy_sighand().

Suggested-by: Oleg Nesterov <[email protected]>
Signed-off-by: Madhuparna Bhowmik <[email protected]>
---
kernel/fork.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/fork.c b/kernel/fork.c
index 2508a4f238a3..42b71d4a50cb 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1508,7 +1508,7 @@ static int copy_sighand(unsigned long clone_flags, struct task_struct *tsk)
return 0;
}
sig = kmem_cache_alloc(sighand_cachep, GFP_KERNEL);
- rcu_assign_pointer(tsk->sighand, sig);
+ RCU_INIT_POINTER(tsk->sighand, sig);
if (!sig)
return -ENOMEM;

--
2.17.1


2020-01-28 09:05:35

by Christian Brauner

[permalink] [raw]
Subject: Re: [PATCH] fork.c: Use RCU_INIT_POINTER() instead of rcu_access_pointer()

On Mon, Jan 27, 2020 at 11:28:21PM +0530, [email protected] wrote:
> From: Madhuparna Bhowmik <[email protected]>
>
> Use RCU_INIT_POINTER() instead of rcu_access_pointer() in
> copy_sighand().
>
> Suggested-by: Oleg Nesterov <[email protected]>
> Signed-off-by: Madhuparna Bhowmik <[email protected]>

Thanks!
Acked-by: Christian Brauner <[email protected]>

2020-01-28 15:01:48

by Oleg Nesterov

[permalink] [raw]
Subject: Re: [PATCH] fork.c: Use RCU_INIT_POINTER() instead of rcu_access_pointer()

On 01/27, [email protected] wrote:
>
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -1508,7 +1508,7 @@ static int copy_sighand(unsigned long clone_flags, struct task_struct *tsk)
> return 0;
> }
> sig = kmem_cache_alloc(sighand_cachep, GFP_KERNEL);
> - rcu_assign_pointer(tsk->sighand, sig);
> + RCU_INIT_POINTER(tsk->sighand, sig);

Acked-by: Oleg Nesterov <[email protected]>

2020-01-28 17:53:54

by Christian Brauner

[permalink] [raw]
Subject: Re: [PATCH] fork.c: Use RCU_INIT_POINTER() instead of rcu_access_pointer()

On Mon, Jan 27, 2020 at 11:28:21PM +0530, [email protected] wrote:
> From: Madhuparna Bhowmik <[email protected]>
>
> Use RCU_INIT_POINTER() instead of rcu_access_pointer() in
> copy_sighand().
>
> Suggested-by: Oleg Nesterov <[email protected]>
> Signed-off-by: Madhuparna Bhowmik <[email protected]>

Applied, queued up for post rc1.

Thanks!
Christian