We have a proper refcount on the task so if we get a rsp while R2Ts are queued then we will not crash. We only need to check if a rsp has been processed and if we race it's ok since with a bad target we could get this rsp at any time like after dropping the lock and starting to send data so the lock use doesn't matter. This patch just drops the lock since we will eventually either see the updated state and stop early or we will send all the data. Either way we will not free the task until all refs have been dropped. Signed-off-by: Mike Christie <michael.christie@xxxxxxxxxx> --- drivers/scsi/libiscsi.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index f4881f0..05e329b 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c @@ -1537,8 +1537,6 @@ static int iscsi_xmit_task(struct iscsi_conn *conn, bool has_extra_ref) /* done with this task */ task->last_xfer = jiffies; } - /* regular RX path uses back_lock */ - spin_lock(&conn->session->back_lock); if (rc && task->state == ISCSI_TASK_RUNNING) { /* * get an extra ref that is released next time we access it @@ -1547,7 +1545,6 @@ static int iscsi_xmit_task(struct iscsi_conn *conn, bool has_extra_ref) iscsi_get_task(task); conn->task = task; } - spin_unlock(&conn->session->back_lock); put_task: iscsi_put_task(task); -- 1.8.3.1