linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: scameron@beardog.cce.hp.com,
	Douglas Gilbert <dgilbert@interlog.com>,
	linux-scsi@vger.kernel.org,
	James.Bottomley@HansenPartnership.com, mikem@beardog.cce.hp.com,
	dab@hp.com, hch@infradead.org,
	FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Subject: Re: Is this a known problem with the SCSI mid layer?
Date: Fri, 15 Jan 2010 09:10:30 +0100	[thread overview]
Message-ID: <20100115081030.GZ13771@kernel.dk> (raw)
In-Reply-To: <4B4FAC25.1050504@s5r6.in-berlin.de>

On Fri, Jan 15 2010, Stefan Richter wrote:
> scameron@beardog.cce.hp.com wrote:
> > On Thu, Jan 14, 2010 at 01:24:59PM -0500, Douglas Gilbert wrote:
> >> scameron@beardog.cce.hp.com wrote:
> >>> I'm seeing a problem which I think is a problem in the SCSI mid layer.
> [...]
> >>> Remove the device while something has it open:
> [...]
> >>> [root@slicer ~]# rmmod hpsa
> >>> ERROR: Module hpsa is in use
> 
> The sg driver's open method takes a reference to the underlying SCSI
> device representation of the mid layer.  Among else, this step increases
> the module use count of the respective low-level driver (transport layer
> driver) so that the SCSI mid layer can be sure that function pointers to
> driver methods stay valid during the lifetime of the SCSI device
> representation.
> 
> This reference taking is of course being reversed when the sg driver
> finishes its last uses of the underlying SCSI device.  This may be at
> the respective close() or even later.
> 
> In short, it is normal, expected, and necessary what you are seeing.

Hmm... Unless I'm reading Stephens email incorrectly, he's holding the
device open, removing it, closing the device, and then attempting to
remove the host driver. So at the point that he wants to rmmod the
module, there is indeed no references to it anymore.

It looks like a bug.

-- 
Jens Axboe


  reply	other threads:[~2010-01-15  8:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-14 16:56 Is this a known problem with the SCSI mid layer? scameron
2010-01-14 18:24 ` Douglas Gilbert
2010-01-14 19:00   ` scameron
2010-01-14 20:07   ` scameron
2010-01-14 23:43     ` Stefan Richter
2010-01-15  8:10       ` Jens Axboe [this message]
2010-01-15  9:03         ` Stefan Richter
2010-01-15 21:44           ` scameron
2010-01-16 11:47             ` FUJITA Tomonori
  -- strict thread matches above, loose matches on Subject: below --
2010-01-15  2:14 Stephen Cameron
2010-01-15 13:02 ` Stefan Richter
2010-01-15 14:18   ` Stephen Cameron
2010-01-15 17:50     ` Douglas Gilbert

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=20100115081030.GZ13771@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=dab@hp.com \
    --cc=dgilbert@interlog.com \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=hch@infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mikem@beardog.cce.hp.com \
    --cc=scameron@beardog.cce.hp.com \
    --cc=stefanr@s5r6.in-berlin.de \
    /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;
as well as URLs for NNTP newsgroup(s).