RE: [PATCH rdma-next 5/9] RDMA/core: Restrict sysfs entries view to init_net

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

 




> -----Original Message-----
> From: Jason Gunthorpe <jgg@xxxxxxxx>
> Sent: Sunday, November 25, 2018 9:16 PM
> To: Parav Pandit <parav@xxxxxxxxxxxx>
> Cc: Leon Romanovsky <leon@xxxxxxxxxx>; Doug Ledford
> <dledford@xxxxxxxxxx>; Leon Romanovsky <leonro@xxxxxxxxxxxx>; RDMA
> mailing list <linux-rdma@xxxxxxxxxxxxxxx>; Daniel Jurgens
> <danielj@xxxxxxxxxxxx>
> Subject: Re: [PATCH rdma-next 5/9] RDMA/core: Restrict sysfs entries view to
> init_net
> 
> On Sat, Nov 24, 2018 at 02:18:24PM +0000, Parav Pandit wrote:
> 
> > > >  static struct class ib_class = {
> > > > -	.name    = "infiniband",
> > > > -	.dev_release = ib_device_release,
> > > > -	.dev_uevent = ib_device_uevent,
> > > > +	.name		= "infiniband",
> > > > +	.dev_release	= ib_device_release,
> > > > +	.dev_uevent	= ib_device_uevent,
> > > > +	.ns_type	= &net_ns_type_operations,
> > > > +	.namespace	= net_namespace,
> > > >  };
> > >
> > > and lets not reformat code just to add horizonal whitespace please.
> > >
> > I see. 4 out of the 5 fields of structure follows right alignment, but keep old
> one as is?
> > But ok.
> 
> Don't do vertical alignment then only 1 out of 5 is wrong.
>
Ok.

> > > > +fs_initcall(ib_core_init);
> > >
> > > Really? So very strange.
> > >
> > Yes. when module is compile as in-built to kernel, init sequence needs first
> initialize the net's init function first.
> > Otherwise ib_core_init gets called and accesses uninitialized
> net_ns_operations.
> > This is similar to 80211 net/wireless/core.c
> 
> And subsyste_late_initcall() is not OK?
>
late_initcall() is after device_initcall().
Apparently commit a9cd1a673737 needs before device initialization.
So late_initcall() is late and bug fixed in  commit a9cd1a673737 will surface again.
So that is why fs_initcall is chosen, after net init and before device init.




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux