scsi: libiscsi: Fix locking in __iscsi_conn_send_pdu
authorJitendra Bhivare <jitendra.bhivare@broadcom.com>
Thu, 13 Oct 2016 06:38:48 +0000 (12:08 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 17 Oct 2016 17:34:44 +0000 (13:34 -0400)
commit4fa507992f0a1063d7326abaf705f9408548349e
tree4896b7a0375fcf61c935b86e67ba9239b65563d6
parent8a4236a2c7868768943a24dc7b1e2ff495836880
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>
drivers/scsi/libiscsi.c