Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c53a284f authored by Edward Goggin's avatar Edward Goggin Committed by James Bottomley
Browse files

[SCSI] initialize max_target_blocked in scsi_alloc_target



This patch initializes the max_target_blocked field of a scsi target
structure so that a queuecommand return value of
SCSI_MLQUEUE_TARGET_BUSY will actually result in having the
scsi_queue_insert blocking the device queue before requeuing the
command and running the queue.  Otherwise, can and does cause livelock
on single CPU configurations if/when open-iSCSI software initiator's
command PDU window fills.

Signed-off-by: default avatarEd Goggin <egoggin@vmware.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 5df6d737
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -425,6 +425,7 @@ static struct scsi_target *scsi_alloc_target(struct device *parent,
	INIT_LIST_HEAD(&starget->devices);
	INIT_LIST_HEAD(&starget->devices);
	starget->state = STARGET_CREATED;
	starget->state = STARGET_CREATED;
	starget->scsi_level = SCSI_2;
	starget->scsi_level = SCSI_2;
	starget->max_target_blocked = SCSI_DEFAULT_TARGET_BLOCKED;
 retry:
 retry:
	spin_lock_irqsave(shost->host_lock, flags);
	spin_lock_irqsave(shost->host_lock, flags);