提交 994442e8 编写于 作者: M Mike Christie 提交者: James Bottomley

[SCSI] iscsi: fix run list corruption

from davidw@netapp.com:

We must grab the session lock when modifying the running lists.
Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
上级 67a61114
...@@ -552,8 +552,10 @@ static int iscsi_data_xmit(struct iscsi_conn *conn) ...@@ -552,8 +552,10 @@ static int iscsi_data_xmit(struct iscsi_conn *conn)
if (unlikely(__kfifo_len(conn->immqueue))) { if (unlikely(__kfifo_len(conn->immqueue))) {
while (__kfifo_get(conn->immqueue, (void*)&conn->mtask, while (__kfifo_get(conn->immqueue, (void*)&conn->mtask,
sizeof(void*))) { sizeof(void*))) {
spin_lock_bh(&conn->session->lock);
list_add_tail(&conn->mtask->running, list_add_tail(&conn->mtask->running,
&conn->mgmt_run_list); &conn->mgmt_run_list);
spin_unlock_bh(&conn->session->lock);
if (tt->xmit_mgmt_task(conn, conn->mtask)) if (tt->xmit_mgmt_task(conn, conn->mtask))
goto again; goto again;
} }
...@@ -568,8 +570,10 @@ static int iscsi_data_xmit(struct iscsi_conn *conn) ...@@ -568,8 +570,10 @@ static int iscsi_data_xmit(struct iscsi_conn *conn)
* iscsi tcp may readd the task to the xmitqueue to send * iscsi tcp may readd the task to the xmitqueue to send
* write data * write data
*/ */
spin_lock_bh(&conn->session->lock);
if (list_empty(&conn->ctask->running)) if (list_empty(&conn->ctask->running))
list_add_tail(&conn->ctask->running, &conn->run_list); list_add_tail(&conn->ctask->running, &conn->run_list);
spin_unlock_bh(&conn->session->lock);
if (tt->xmit_cmd_task(conn, conn->ctask)) if (tt->xmit_cmd_task(conn, conn->ctask))
goto again; goto again;
} }
...@@ -580,8 +584,10 @@ static int iscsi_data_xmit(struct iscsi_conn *conn) ...@@ -580,8 +584,10 @@ static int iscsi_data_xmit(struct iscsi_conn *conn)
if (unlikely(__kfifo_len(conn->mgmtqueue))) { if (unlikely(__kfifo_len(conn->mgmtqueue))) {
while (__kfifo_get(conn->mgmtqueue, (void*)&conn->mtask, while (__kfifo_get(conn->mgmtqueue, (void*)&conn->mtask,
sizeof(void*))) { sizeof(void*))) {
spin_lock_bh(&conn->session->lock);
list_add_tail(&conn->mtask->running, list_add_tail(&conn->mtask->running,
&conn->mgmt_run_list); &conn->mgmt_run_list);
spin_unlock_bh(&conn->session->lock);
if (tt->xmit_mgmt_task(conn, conn->mtask)) if (tt->xmit_mgmt_task(conn, conn->mtask))
goto again; goto again;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册