Thread (78 messages) 78 messages, 12 authors, 2025-10-24

Re: [PATCH 14/32] net: use ns_common_init()

From: Jan Kara <jack@suse.cz>
Date: 2025-09-11 09:19:32
Also in: cgroups, linux-block, linux-fsdevel, linux-kselftest, linux-nfs, lkml

On Thu 11-09-25 10:46:11, Christian Brauner wrote:
On Wed, Sep 10, 2025 at 05:57:52PM +0200, Jan Kara wrote:
quoted
On Wed 10-09-25 16:36:59, Christian Brauner wrote:
quoted
Don't cargo-cult the same thing over and over.

Signed-off-by: Christian Brauner <brauner@kernel.org>
One comment below.
quoted
@@ -812,17 +828,14 @@ static void net_ns_net_debugfs(struct net *net)
 
 static __net_init int net_ns_net_init(struct net *net)
 {
-#ifdef CONFIG_NET_NS
-	net->ns.ops = &netns_operations;
-#endif
-	net->ns.inum = PROC_NET_INIT_INO;
-	if (net != &init_net) {
-		int ret = ns_alloc_inum(&net->ns);
-		if (ret)
-			return ret;
-	}
+	int ret = 0;
+
+	if (net == &init_net)
+		net->ns.inum = PROC_NET_INIT_INO;
+	else
+		ret = proc_alloc_inum(&to_ns_common(net)->inum);
 	net_ns_net_debugfs(net);
Here you're calling net_ns_net_debugfs() even if proc_alloc_inum() failed
which looks like a bug to me...
Yes, good catch!

Fyi, I have been out properly sick this week and that's why I haven't
been very active on-list. I hope to be back in a more functional state
tomorrow and will process the backlog.
There's no rush. Get well soon!

								Honza
-- 
Jan Kara [off-list ref]
SUSE Labs, CR
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help