From: James Bottomley <James.Bottomley@suse.de>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: SCSI development list <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH 5/5] SCSI: fix target allocation outside of scan_mutex
Date: Fri, 19 Feb 2010 10:34:55 -0600 [thread overview]
Message-ID: <1266597295.2822.50.camel@mulgrave.site> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1002121212020.1307-100000@iolanthe.rowland.org>
On Fri, 2010-02-12 at 12:14 -0500, Alan Stern wrote:
> This patch (as1337) fixes a bug in __scsi_add_device(). It calls
> scsi_alloc_target() outside the protection of the host's scan_mutex,
> meaning that it might find an incompletely-initialized target or it
> might create a duplicate target.
I don't think this is correct. scsi_alloc_target should be completely
atomic on the host lock, if you look. It allocates the proposed target,
takes the lock and searches the host target list ... if it finds
something it drops the lock, destroys the proposed target allocations
and returns what it found. If it finds nothing, it adds the proposed
target to the list drops the lock and returns it. There's some
complexity around finding dying targets, but nothing that I think needs
to be mediated by the scan mutex.
James
next prev parent reply other threads:[~2010-02-19 16:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-12 17:14 [PATCH 5/5] SCSI: fix target allocation outside of scan_mutex Alan Stern
2010-02-19 16:34 ` James Bottomley [this message]
2010-02-19 20:21 ` Alan Stern
2010-03-12 21:45 ` James Bottomley
2010-03-13 15:51 ` Alan Stern
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=1266597295.2822.50.camel@mulgrave.site \
--to=james.bottomley@suse.de \
--cc=linux-scsi@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/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