Re: sysfs-related oops during module unload (2.6.16-rc2)

Greg KH
2006-02-12T05:39:03Z

On Sat, Feb 11, 2006 at 11:27:52PM -0600, Nathan Lynch wrote:
> Greg KH wrote:
> > On Sat, Feb 11, 2006 at 04:03:53PM -0600, Nathan Lynch wrote:
> > > If the refcnt attribute of a module is open when the module is
> > > unloaded, we get an oops when the file is closed. I used ide_cd for
> > > this report but I don't think the oops is caused by the driver itself.
> > > This bug seems to be restricted to the /sys/module hierarchy; it
> > > doesn't happen with /sys/class etc.
> > >
> > > I suspect it's an extra put or a missing get somewhere, but the fix
> > > isn't obvious to me after looking at it for a little while, so I'm
> > > punting.
> > >
> > > I'm pretty sure this happens with 2.6.15; I can double-check if
> > > needed.
> >
> > Ugh, we aren't setting the owner of these fields properly, good catch.
> >
> > Does the patch below (built tested only), solve this for you?
>
> Thanks, but no, I get the same oops. The refcnt attribute isn't part
> of the modinfo_attrs array.

Ah, crap, you're right. We really need to dynamically create these
attributes for every module to get the owner right. That will be a
bigger patch that I'll work on on Monday...

thanks for testing,

greg k-h