From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Cc: linux-scsi <linux-scsi@vger.kernel.org>,
Fubo Chen <fubo.chen@gmail.com>, Christoph Hellwig <hch@lst.de>,
James Bottomley <James.Bottomley@HansenPartnership.com>
Subject: Re: [PATCH 2/3] target: Reaquire hba_lock + se_port_lock during se_clear_dev_ports continue
Date: Tue, 25 Jan 2011 15:39:26 +0100 [thread overview]
Message-ID: <20110125153926.710639bd@stein> (raw)
In-Reply-To: <1295918416.24778.157.camel@haakon2.linux-iscsi.org>
On Jan 24 Nicholas A. Bellinger wrote:
> On Tue, 2011-01-25 at 01:08 +0100, Stefan Richter wrote:
> > void se_clear_dev_ports(struct se_device *dev)
[...]
> > Can this mess of releasing and reacquiring locks --- which looks all rather
> > dangerous --- be cleaned up if you move the logical units (?) to be deleted
> > over to a secondary list?
>
> Fair point on this one. Having to sleep in core_dev_del_lun() waiting
> for all outstanding struct se_cmd -> struct se_lun I/O descriptor
> mappings to be shutdown makes this look pretty ugly currently in
> se_clear_dev_ports(). However adding another list+lock to this mix
> really does not make it any less complex.
I meant an on-stack throwaway list which you can change inside
se_clear_dev_ports() without any lock. But I didn't look whether this is
actually possible and beneficial.
> Looking at se_clear_dev_ports() again in the two usage contexts
> target_core_device.c:se_free_virtual_device() and
> target_core_hba.c:core_delete_hba(),
[...]
> config_group structures, I think se_clear_dev_ports() should be able to
> be dropped all together now.
That of course sounds great.
> I will take a deeper look and see if this
> is really in fact safe for v4.0/for-38 code.
As a thought from an outsider: If drivers/target/ weren't entirely new in
2.6.38, then only a minimal cautious locking fix would be post -rc1
material. Linus releases so frequently that anything beyond essential
fixes can easily wait for regular merge windows. "Essential" = very low
risk : reward ratio && with reasonable reward. Those who directly work
with the code tend to underestimate risk and to overestimate reward. ;-)
--
Stefan Richter
-=====-==-== ---= ==--=
http://arcgraph.de/sr/
next prev parent reply other threads:[~2011-01-25 14:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-24 20:37 [PATCH 0/3] target: Sparse bugfixes and warnings/annotations Nicholas A. Bellinger
2011-01-24 20:37 ` [PATCH 1/3] target: Drop nacl->device_list_lock on core_update_device_list_for_node failure Nicholas A. Bellinger
2011-01-24 20:37 ` [PATCH 2/3] target: Reaquire hba_lock + se_port_lock during se_clear_dev_ports continue Nicholas A. Bellinger
2011-01-25 0:08 ` Stefan Richter
2011-01-25 1:20 ` Nicholas A. Bellinger
2011-01-25 2:03 ` Nicholas A. Bellinger
2011-01-25 14:39 ` Stefan Richter [this message]
2011-01-24 20:37 ` [PATCH 3/3] target: Minor sparse warning fixes and annotations Nicholas A. Bellinger
2011-01-24 20:56 ` James Bottomley
2011-01-24 21:33 ` Nicholas A. Bellinger
2011-01-24 21:51 ` James Bottomley
2011-01-24 22:12 ` Nicholas A. Bellinger
2011-01-24 23:56 ` Stefan Richter
2011-01-25 0:37 ` Nicholas A. Bellinger
2011-01-24 23:18 ` Joe Eykholt
2011-01-24 23:25 ` Nicholas A. Bellinger
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=20110125153926.710639bd@stein \
--to=stefanr@s5r6.in-berlin.de \
--cc=James.Bottomley@HansenPartnership.com \
--cc=fubo.chen@gmail.com \
--cc=hch@lst.de \
--cc=linux-scsi@vger.kernel.org \
--cc=nab@linux-iscsi.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