All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: linux-scsi <linux-scsi@vger.kernel.org>
Cc: Christoph Hellwig <hch@lst.de>,
	James Bottomley <James.Bottomley@HansenPartnership.com>,
	Fubo Chen <fubo.chen@gmail.com>,
	"Nicholas A. Bellinger" <nab@linux-iscsi.org>
Subject: [PATCH 2/3] target: Reaquire hba_lock + se_port_lock during se_clear_dev_ports continue
Date: Mon, 24 Jan 2011 12:37:25 -0800	[thread overview]
Message-ID: <1295901446-17089-3-git-send-email-nab@linux-iscsi.org> (raw)
In-Reply-To: <1295901446-17089-1-git-send-email-nab@linux-iscsi.org>

From: Fubo Chen <fubo.chen@gmail.com>

This patch reaquires hba->device_lock and dev->se_port_lock in
se_clear_dev_ports() if lun->lun_se_dev is NULL and we need
to continue in dev->dev_sep_list.

Signed-off-by: Fubo Chen <fubo.chen@gmail.com>
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
---
 drivers/target/target_core_device.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index 95dfe3a..02b835f 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -796,6 +796,8 @@ void se_clear_dev_ports(struct se_device *dev)
 		spin_lock(&lun->lun_sep_lock);
 		if (lun->lun_se_dev == NULL) {
 			spin_unlock(&lun->lun_sep_lock);
+			spin_lock(&hba->device_lock);
+			spin_lock(&dev->se_port_lock);
 			continue;
 		}
 		spin_unlock(&lun->lun_sep_lock);
-- 
1.5.6.5


  parent reply	other threads:[~2011-01-24 20:37 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 ` Nicholas A. Bellinger [this message]
2011-01-25  0:08   ` [PATCH 2/3] target: Reaquire hba_lock + se_port_lock during se_clear_dev_ports continue 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
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=1295901446-17089-3-git-send-email-nab@linux-iscsi.org \
    --to=nab@linux-iscsi.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=fubo.chen@gmail.com \
    --cc=hch@lst.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.