[PATCH 2/3] target: Reaquire hba_lock + se_port_lock during se_clear_dev_ports continue

Nicholas A. Bellinger
2011-01-24T20:37:18Z

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