From: zhenyu.z.wang@intel.com Date: Sat, 14 Jan 2006 00:05:41 +0000 (-0600) Subject: [SCSI] iscsi: host locking fix X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=3e97c7e6cda933e3a1b518a8100d155c532a3cfc;p=openwrt%2Fstaging%2Fblogic.git [SCSI] iscsi: host locking fix We should be taking the host_lock instead of the conn lock when checking host_busy. Signed-off-by: Alex Aizman Signed-off-by: Dmitry Yusupov Signed-off-by: Mike Christie Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c index 550ff66ba9ec..cd1491e52361 100644 --- a/drivers/scsi/iscsi_tcp.c +++ b/drivers/scsi/iscsi_tcp.c @@ -2559,6 +2559,7 @@ iscsi_conn_destroy(iscsi_connh_t connh) { struct iscsi_conn *conn = iscsi_ptr(connh); struct iscsi_session *session = conn->session; + unsigned long flags; mutex_lock(&conn->xmitmutex); set_bit(SUSPEND_BIT, &conn->suspend_tx); @@ -2598,12 +2599,12 @@ iscsi_conn_destroy(iscsi_connh_t connh) * time out or fail. */ for (;;) { - spin_lock_bh(&conn->lock); + spin_lock_irqsave(session->host->host_lock, flags); if (!session->host->host_busy) { /* OK for ERL == 0 */ - spin_unlock_bh(&conn->lock); + spin_unlock_irqrestore(session->host->host_lock, flags); break; } - spin_unlock_bh(&conn->lock); + spin_unlock_irqrestore(session->host->host_lock, flags); msleep_interruptible(500); printk("conn_destroy(): host_busy %d host_failed %d\n", session->host->host_busy, session->host->host_failed);