From: Michael Reed <mdr@sgi.com>
To: James.Smart@Emulex.Com
Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>, linux-scsi@vger.kernel.org
Subject: Re: [Comments Needed] scan vs remove_target deadlock
Date: Wed, 19 Apr 2006 10:34:19 -0500 [thread overview]
Message-ID: <4446587B.60709@sgi.com> (raw)
In-Reply-To: <44455BAA.6080509@emulex.com>
James Smart wrote:
> Michael Reed wrote:
>> The remove is not for the target which holds the scsi host's scan mutex.
>> Hence, the unblock doesn't kick the [right] queue.
>
> Certainly could be true.
I don't think it would deadlock if it wasn't. The scan mutex is a rather
gross lock.
>
>> I think this means that transport cannot call scsi_remove_target() for any
>> target if a scan is running. So, transport has to wait until it can assure
>> that no scan is running, perhaps a new mutex, and has to have a way of kicking
>> a blocked target which is being scanned, either when the LLDD unblocks
>> the target or the delete work for that target fires.
>
> Well - that's one way. Very difficult for the transport to know when this is
> true (not all scans occur from the transport). It should be a midlayer thing
> to ensure the proper things happen. Also highlights just how gross the that
> scan_lock is - which is where the real fix should be, although this will be
> a rats nest.
There's fc_user_scan() which I believe handles scans initiated
via the sysfs/proc variables. There's fc_scsi_scan_rport() run via the scan work.
It appears that the routines that perform a scan, in a fibre channel context,
are all entered via the transport.
What am I missing?
Mike
>
> -- james s
>
prev parent reply other threads:[~2006-04-19 15:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-10 18:25 [Comments Needed] scan vs remove_target deadlock James Smart
2006-04-11 4:03 ` Mike Christie
2006-04-13 15:14 ` James Smart
2006-04-14 4:23 ` Mike Christie
2006-04-14 10:19 ` James Smart
2006-04-14 17:48 ` Mike Christie
2006-04-14 17:58 ` Mike Christie
2006-04-11 8:53 ` Stefan Richter
2006-04-13 15:21 ` James Smart
2006-04-14 19:16 ` Stefan Richter
2006-04-18 20:09 ` Michael Reed
2006-04-18 21:35 ` James Smart
2006-04-19 15:34 ` Michael Reed [this message]
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=4446587B.60709@sgi.com \
--to=mdr@sgi.com \
--cc=James.Smart@Emulex.Com \
--cc=linux-scsi@vger.kernel.org \
--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).