Re: [RFC 1/1] libiscsi: Fix race between iscsi_xmit_task and iscsi_complete_task

From: Anoob Soman
Date: Tue Jul 17 2018 - 11:56:52 EST


On 09/07/18 11:43, Anoob Soman wrote:
On 02/07/18 16:00, Anoob Soman wrote:
---
 drivers/scsi/libiscsi.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index d609383..aa3be6f 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -1449,7 +1449,13 @@ static int iscsi_xmit_task(struct iscsi_conn *conn)
ÂÂÂÂÂ if (test_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx))
ÂÂÂÂÂÂÂÂÂ return -ENODATA;
 + spin_lock_bh(&conn->session->back_lock);
+ÂÂÂ if (conn->task == NULL) {
+ÂÂÂÂÂÂÂ spin_unlock_bh(&conn->session->back_lock);
+ÂÂÂÂÂÂÂ return -ENODATA;
+ÂÂÂ }
ÂÂÂÂÂ __iscsi_get_task(task);
+ÂÂÂ spin_unlock_bh(&conn->session->back_lock);
ÂÂÂÂÂ spin_unlock_bh(&conn->session->frwd_lock);
ÂÂÂÂÂ rc = conn->session->tt->xmit_task(task);
ÂÂÂÂÂ spin_lock_bh(&conn->session->frwd_lock);


Hi Chris, Lee.

Could one of you look at this change and provide some comments ?

Thanks,

-Anoob.


Hi,

Can someone look at this change ?

Thanks,

Anoob.