* [PATCH v1] rcu: use hlist_nulls_next_rcu() in hlist_nulls_add_tail_rcu()
@ 2022-10-19 12:36 zhaomzhao
2022-10-20 18:44 ` Paul E. McKenney
0 siblings, 1 reply; 2+ messages in thread
From: zhaomzhao @ 2022-10-19 12:36 UTC (permalink / raw)
To: paulmck, frederic, quic_neeraju, josh, rostedt,
mathieu.desnoyers, jiangshanlai, joel, edumazet
Cc: rcu, linux-kernel, Zhao Mengmeng
From: Zhao Mengmeng <zhaomengmeng@kylinos.cn>
In commit 8dbd76e79a16 ("tcp/dccp: fix possible race
__inet_lookup_established()"), function hlist_nulls_add_tail_rcu() was
added back, but the local variable *last* is of type hlist_nulls_node,
so use hlist_nulls_next_rcu() instead of hlist_next_rcu().
Signed-off-by: Zhao Mengmeng <zhaomengmeng@kylinos.cn>
---
include/linux/rculist_nulls.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/rculist_nulls.h b/include/linux/rculist_nulls.h
index d8afdb8784c1..ba4c00dd8005 100644
--- a/include/linux/rculist_nulls.h
+++ b/include/linux/rculist_nulls.h
@@ -139,7 +139,7 @@ static inline void hlist_nulls_add_tail_rcu(struct hlist_nulls_node *n,
if (last) {
n->next = last->next;
n->pprev = &last->next;
- rcu_assign_pointer(hlist_next_rcu(last), n);
+ rcu_assign_pointer(hlist_nulls_next_rcu(last), n);
} else {
hlist_nulls_add_head_rcu(n, h);
}
--
2.37.1
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH v1] rcu: use hlist_nulls_next_rcu() in hlist_nulls_add_tail_rcu()
2022-10-19 12:36 [PATCH v1] rcu: use hlist_nulls_next_rcu() in hlist_nulls_add_tail_rcu() zhaomzhao
@ 2022-10-20 18:44 ` Paul E. McKenney
0 siblings, 0 replies; 2+ messages in thread
From: Paul E. McKenney @ 2022-10-20 18:44 UTC (permalink / raw)
To: zhaomzhao
Cc: frederic, quic_neeraju, josh, rostedt, mathieu.desnoyers,
jiangshanlai, joel, edumazet, rcu, linux-kernel, Zhao Mengmeng
On Wed, Oct 19, 2022 at 08:36:50AM -0400, zhaomzhao@126.com wrote:
> From: Zhao Mengmeng <zhaomengmeng@kylinos.cn>
>
> In commit 8dbd76e79a16 ("tcp/dccp: fix possible race
> __inet_lookup_established()"), function hlist_nulls_add_tail_rcu() was
> added back, but the local variable *last* is of type hlist_nulls_node,
> so use hlist_nulls_next_rcu() instead of hlist_next_rcu().
>
> Signed-off-by: Zhao Mengmeng <zhaomengmeng@kylinos.cn>
Good eyes!
I have queued this for testing and further review.
Thanx, Paul
> ---
> include/linux/rculist_nulls.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/rculist_nulls.h b/include/linux/rculist_nulls.h
> index d8afdb8784c1..ba4c00dd8005 100644
> --- a/include/linux/rculist_nulls.h
> +++ b/include/linux/rculist_nulls.h
> @@ -139,7 +139,7 @@ static inline void hlist_nulls_add_tail_rcu(struct hlist_nulls_node *n,
> if (last) {
> n->next = last->next;
> n->pprev = &last->next;
> - rcu_assign_pointer(hlist_next_rcu(last), n);
> + rcu_assign_pointer(hlist_nulls_next_rcu(last), n);
> } else {
> hlist_nulls_add_head_rcu(n, h);
> }
> --
> 2.37.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-10-20 18:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-19 12:36 [PATCH v1] rcu: use hlist_nulls_next_rcu() in hlist_nulls_add_tail_rcu() zhaomzhao
2022-10-20 18:44 ` Paul E. McKenney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®