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]

 



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.

> > > +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?

Jason



[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