diff options
author | Jitendra Bhivare <jitendra.bhivare@broadcom.com> | 2016-10-13 02:38:48 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-10-17 13:34:44 -0400 |
commit | 4fa507992f0a1063d7326abaf705f9408548349e (patch) | |
tree | 4896b7a0375fcf61c935b86e67ba9239b65563d6 | |
parent | 8a4236a2c7868768943a24dc7b1e2ff495836880 (diff) |
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>
-rw-r--r-- | drivers/scsi/libiscsi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index c051694bfcb0..f9b6fba689ff 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c | |||
@@ -791,9 +791,9 @@ __iscsi_conn_send_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr, | |||
791 | 791 | ||
792 | free_task: | 792 | free_task: |
793 | /* regular RX path uses back_lock */ | 793 | /* regular RX path uses back_lock */ |
794 | spin_lock_bh(&session->back_lock); | 794 | spin_lock(&session->back_lock); |
795 | __iscsi_put_task(task); | 795 | __iscsi_put_task(task); |
796 | spin_unlock_bh(&session->back_lock); | 796 | spin_unlock(&session->back_lock); |
797 | return NULL; | 797 | return NULL; |
798 | } | 798 | } |
799 | 799 | ||