Re: qla2300 & mptscsih refcount, or lack thereof

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

 



On Fri, Dec 30, 2005 at 03:50:30PM -0800, Joel Becker wrote:
> Folks,
> 	I've run into an interesting problem.  The qla2300 and
> mptspi drivers don't get refcounted for active users, but they are
> absolutely required.  Thus, you can do, eg, "rmmod qla2300" with mounted
> filesystems, and your system happily removes all child devices.
> Hello, EIO!
> 	Now, I know we're well into "Doctor, it hurts when I do this,"
> territory here.  But we generally try not to allow this sort of mistake.
> You can't remove a network card while the interface is up, you can't
> remove sd_mod while a disk is in use, etc.
> 	Has this been seen before?  Is there any plan to make qla2300
> and mptspi respect the use count of the objects they present to the
> system?  Thoughts?

The qla driver increments the underlying qla2xxx module ref count rather
than the qla2n00 module. Look at qla_os.c setting of .module, and
scsi_device_get() code, and the complete lsmod output. qla_os.c code is
included in qla2xxx, so its THIS_MODULE references qla2xxx instead of
qla2n00.

The code would have to change to set the correct THIS_MODULE for use in
scsi_device_get(), the qla2n00 can't just override the template, else you
would get bad module ref counts if you had mixed qla hardware in your
system.

We probably need to duplicate the .module in struct scsi_host, set it
appropriately (by default copy struct scsi_host_template value), and then
use it in scsi_device_get().

I haven't looked at mptspi drivers.

-- Patrick Mansfield
-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux