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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 10, 2025 at 05:57:52PM +0200, Jan Kara wrote:
> On Wed 10-09-25 16:36:59, Christian Brauner wrote:
> > Don't cargo-cult the same thing over and over.
> > 
> > Signed-off-by: Christian Brauner <brauner@xxxxxxxxxx>
> 
> One comment below.
> 
> > @@ -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.




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux