public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Patrick Mansfield <patmans@us.ibm.com>
To: andrew.vasquez@qlogic.com, Eric.Moore@lsil.com,
	linux-scsi@vger.kernel.org,
	James Bottomley <James.Bottomley@steeleye.com>
Subject: Re: qla2300 & mptscsih refcount, or lack thereof
Date: Tue, 3 Jan 2006 11:17:40 -0800	[thread overview]
Message-ID: <20060103191740.GA20527@us.ibm.com> (raw)
In-Reply-To: <20051230235030.GX18439@ca-server1.us.oracle.com>

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

  reply	other threads:[~2006-01-03 19:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-30 23:50 qla2300 & mptscsih refcount, or lack thereof Joel Becker
2006-01-03 19:17 ` Patrick Mansfield [this message]
2006-01-03 19:28   ` Andrew Vasquez
  -- strict thread matches above, loose matches on Subject: below --
2006-01-03 22:03 Moore, Eric

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060103191740.GA20527@us.ibm.com \
    --to=patmans@us.ibm.com \
    --cc=Eric.Moore@lsil.com \
    --cc=James.Bottomley@steeleye.com \
    --cc=andrew.vasquez@qlogic.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox