aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libiscsi.c
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2006-05-30 01:37:22 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-06-05 19:11:18 -0400
commit994442e807782d68bb1d3ae34044f95990411a22 (patch)
tree09535e792aabe72306c44c4eb8a962f1177edbf4 /drivers/scsi/libiscsi.c
parent67a611149b2ac5f4af1e36bfffbfe3198cd3712c (diff)
[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/libiscsi.c')
-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)
552 if (unlikely(__kfifo_len(conn->immqueue))) { 552 if (unlikely(__kfifo_len(conn->immqueue))) {
553 while (__kfifo_get(conn->immqueue, (void*)&conn->mtask, 553 while (__kfifo_get(conn->immqueue, (void*)&conn->mtask,
554 sizeof(void*))) { 554 sizeof(void*))) {
555 spin_lock_bh(&conn->session->lock);
555 list_add_tail(&conn->mtask->running, 556 list_add_tail(&conn->mtask->running,
556 &conn->mgmt_run_list); 557 &conn->mgmt_run_list);
558 spin_unlock_bh(&conn->session->lock);
557 if (tt->xmit_mgmt_task(conn, conn->mtask)) 559 if (tt->xmit_mgmt_task(conn, conn->mtask))
558 goto again; 560 goto again;
559 } 561 }
@@ -568,8 +570,10 @@ static int iscsi_data_xmit(struct iscsi_conn *conn)
568 * iscsi tcp may readd the task to the xmitqueue to send 570 * iscsi tcp may readd the task to the xmitqueue to send
569 * write data 571 * write data
570 */ 572 */
573 spin_lock_bh(&conn->session->lock);
571 if (list_empty(&conn->ctask->running)) 574 if (list_empty(&conn->ctask->running))
572 list_add_tail(&conn->ctask->running, &conn->run_list); 575 list_add_tail(&conn->ctask->running, &conn->run_list);
576 spin_unlock_bh(&conn->session->lock);
573 if (tt->xmit_cmd_task(conn, conn->ctask)) 577 if (tt->xmit_cmd_task(conn, conn->ctask))
574 goto again; 578 goto again;
575 } 579 }
@@ -580,8 +584,10 @@ static int iscsi_data_xmit(struct iscsi_conn *conn)
580 if (unlikely(__kfifo_len(conn->mgmtqueue))) { 584 if (unlikely(__kfifo_len(conn->mgmtqueue))) {
581 while (__kfifo_get(conn->mgmtqueue, (void*)&conn->mtask, 585 while (__kfifo_get(conn->mgmtqueue, (void*)&conn->mtask,
582 sizeof(void*))) { 586 sizeof(void*))) {
587 spin_lock_bh(&conn->session->lock);
583 list_add_tail(&conn->mtask->running, 588 list_add_tail(&conn->mtask->running,
584 &conn->mgmt_run_list); 589 &conn->mgmt_run_list);
590 spin_unlock_bh(&conn->session->lock);
585 if (tt->xmit_mgmt_task(conn, conn->mtask)) 591 if (tt->xmit_mgmt_task(conn, conn->mtask))
586 goto again; 592 goto again;
587 } 593 }