diff options
author | Jakub Kicinski <kuba@kernel.org> | 2025-04-22 19:07:45 -0700 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2025-04-22 19:07:45 -0700 |
commit | 84ee6e5040aef7fdf90b30dbedf7bd2cd8bd3d69 (patch) | |
tree | 6260449ca843bb280a201d44894278d3ee10a85d /net/core/net_namespace.c | |
parent | 21b01cb8e88ea200a834a2c114b5dc6aa378ac56 (diff) | |
parent | 7ee32072c732799bcb7221cb97adc0e9e52e3792 (diff) |
Merge branch 'net-followup-series-for-exit_rtnl'
Kuniyuki Iwashima says:
====================
net: Followup series for ->exit_rtnl().
Patch 1 drops the hold_rtnl arg in ops_undo_list() as suggested by Jakub.
Patch 2 & 3 apply ->exit_rtnl() to pfcp and ppp.
v1: https://lore.kernel.org/20250415022258.11491-1-kuniyu@amazon.com
====================
Link: https://patch.msgid.link/20250418003259.48017-1-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core/net_namespace.c')
-rw-r--r-- | net/core/net_namespace.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index 0a2b24af4028..48dd6dc603c9 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c @@ -220,17 +220,20 @@ static void ops_free_list(const struct pernet_operations *ops, static void ops_undo_list(const struct list_head *ops_list, const struct pernet_operations *ops, struct list_head *net_exit_list, - bool expedite_rcu, bool hold_rtnl) + bool expedite_rcu) { const struct pernet_operations *saved_ops; + bool hold_rtnl = false; if (!ops) ops = list_entry(ops_list, typeof(*ops), list); saved_ops = ops; - list_for_each_entry_continue_reverse(ops, ops_list, list) + list_for_each_entry_continue_reverse(ops, ops_list, list) { + hold_rtnl |= !!ops->exit_rtnl; ops_pre_exit_list(ops, net_exit_list); + } /* Another CPU might be rcu-iterating the list, wait for it. * This needs to be before calling the exit() notifiers, so the @@ -257,11 +260,10 @@ static void ops_undo_list(const struct list_head *ops_list, static void ops_undo_single(struct pernet_operations *ops, struct list_head *net_exit_list) { - bool hold_rtnl = !!ops->exit_rtnl; LIST_HEAD(ops_list); list_add(&ops->list, &ops_list); - ops_undo_list(&ops_list, NULL, net_exit_list, false, hold_rtnl); + ops_undo_list(&ops_list, NULL, net_exit_list, false); list_del(&ops->list); } @@ -452,7 +454,7 @@ out_undo: * for the pernet modules whose init functions did not fail. */ list_add(&net->exit_list, &net_exit_list); - ops_undo_list(&pernet_list, ops, &net_exit_list, false, true); + ops_undo_list(&pernet_list, ops, &net_exit_list, false); rcu_barrier(); goto out; } @@ -681,7 +683,7 @@ static void cleanup_net(struct work_struct *work) list_add_tail(&net->exit_list, &net_exit_list); } - ops_undo_list(&pernet_list, NULL, &net_exit_list, true, true); + ops_undo_list(&pernet_list, NULL, &net_exit_list, true); up_read(&pernet_ops_rwsem); |