summaryrefslogtreecommitdiff
path: root/drivers/scsi
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2006-05-30 00:37:22 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-06-05 19:11:18 -0400
commit994442e807782d68bb1d3ae34044f95990411a22 (patch)
tree09535e792aabe72306c44c4eb8a962f1177edbf4 /drivers/scsi
parent67a611149b2ac5f4af1e36bfffbfe3198cd3712c (diff)
downloadlwn-994442e807782d68bb1d3ae34044f95990411a22.tar.gz
lwn-994442e807782d68bb1d3ae34044f95990411a22.zip
[SCSI] iscsi: fix run list corruption
from davidw@netapp.com: We must grab the session lock when modifying the running lists. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/libiscsi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 963002598995..a223413e1564 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -552,8 +552,10 @@ static int iscsi_data_xmit(struct iscsi_conn *conn)
if (unlikely(__kfifo_len(conn->immqueue))) {
while (__kfifo_get(conn->immqueue, (void*)&conn->mtask,
sizeof(void*))) {
+ spin_lock_bh(&conn->session->lock);
list_add_tail(&conn->mtask->running,
&conn->mgmt_run_list);
+ spin_unlock_bh(&conn->session->lock);
if (tt->xmit_mgmt_task(conn, conn->mtask))
goto again;
}
@@ -568,8 +570,10 @@ static int iscsi_data_xmit(struct iscsi_conn *conn)
* iscsi tcp may readd the task to the xmitqueue to send
* write data
*/
+ spin_lock_bh(&conn->session->lock);
if (list_empty(&conn->ctask->running))
list_add_tail(&conn->ctask->running, &conn->run_list);
+ spin_unlock_bh(&conn->session->lock);
if (tt->xmit_cmd_task(conn, conn->ctask))
goto again;
}
@@ -580,8 +584,10 @@ static int iscsi_data_xmit(struct iscsi_conn *conn)
if (unlikely(__kfifo_len(conn->mgmtqueue))) {
while (__kfifo_get(conn->mgmtqueue, (void*)&conn->mtask,
sizeof(void*))) {
+ spin_lock_bh(&conn->session->lock);
list_add_tail(&conn->mtask->running,
&conn->mgmt_run_list);
+ spin_unlock_bh(&conn->session->lock);
if (tt->xmit_mgmt_task(conn, conn->mtask))
goto again;
}