Skip to content

Commit 4fa5079

Browse files
Jitendra Bhivaremartinkpetersen
authored andcommitted
scsi: libiscsi: Fix locking in __iscsi_conn_send_pdu
The code at free_task label in __iscsi_conn_send_pdu can get executed from blk_timeout_work which takes queue_lock using spin_lock_irq. back_lock taken with spin_unlock_bh will cause WARN_ON_ONCE. The code gets executed either with bottom half or IRQ disabled hence using spin_lock/spin_unlock for back_lock is safe. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Chris Leech <cleech@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 8a4236a commit 4fa5079

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/scsi/libiscsi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -791,9 +791,9 @@ __iscsi_conn_send_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
791791

792792
free_task:
793793
/* regular RX path uses back_lock */
794-
spin_lock_bh(&session->back_lock);
794+
spin_lock(&session->back_lock);
795795
__iscsi_put_task(task);
796-
spin_unlock_bh(&session->back_lock);
796+
spin_unlock(&session->back_lock);
797797
return NULL;
798798
}
799799

0 commit comments

Comments
 (0)