Commit 7acee67a6bce ("netns: optimize netns cleaning by batching
unhash_nsid calls") added the is_dying flag in struct net.
It is an alias of !check_net(net), and having two ways to represent
the same state is confusing.
Let's remove the flag.
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
---
include/net/net_namespace.h | 1 -
net/core/net_namespace.c | 3 +--
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 46b4c67e2966..b4247e767d13 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -125,7 +125,6 @@ struct net {
* it is critical that it is on a read_mostly cache line.
*/
u32 hash_mix;
- bool is_dying;
struct net_device *loopback_dev; /* The loopback */
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index da5f881fbd3b..0e13de0cd36b 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -644,7 +644,7 @@ static void unhash_nsid(struct net *last)
int curr_id = id;
id++;
- if (!peer->is_dying)
+ if (check_net(peer))
continue;
idr_remove(&tmp->netns_ids, curr_id);
@@ -681,7 +681,6 @@ static void cleanup_net(struct work_struct *work)
llist_for_each_entry(net, net_kill_list, cleanup_list) {
ns_tree_remove(net);
list_del_rcu(&net->list);
- net->is_dying = true;
}
/* Cache last net. After we unlock rtnl, no one new net
* added to net_namespace_list can assign nsid pointer--
2.56.0.rc1.315.gc6ed9934b7-goog