Skip to content

Commit

Permalink
scsi: libiscsi: Fix locking in __iscsi_conn_send_pdu
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jitendra Bhivare authored and Martin K. Petersen committed Oct 17, 2016
1 parent 8a4236a commit 4fa5079
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/scsi/libiscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -791,9 +791,9 @@ __iscsi_conn_send_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,

free_task:
/* regular RX path uses back_lock */
spin_lock_bh(&session->back_lock);
spin_lock(&session->back_lock);
__iscsi_put_task(task);
spin_unlock_bh(&session->back_lock);
spin_unlock(&session->back_lock);
return NULL;
}

Expand Down

0 comments on commit 4fa5079

Please sign in to comment.