Re: [PATCH] correct module refcounting

James Bottomley
2003-10-31T15:01:15Z

On Fri, 2003-10-31 at 06:18, Christoph Hellwig wrote:
> That would mean we can't rmmod a LLDD without first removing all device
> through sysfs, or did I get it completely wrong?

Yes, I was thinking the wrong way around. I think we need to use the
scsi_get_device() scsi_put_device() to hold a reference to struct
scsi_device in more places than just ULD open/close. However, obviously
we only need a reference to the module when it shouldn't be removed.

Perhaps all that's really necessary is something like splitting
scsi_device_get() into an __ version that does everything but the module
get. Then we can use the __scsi_device_get() in the critical sections.

James