mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-07 02:19:54 +00:00
scsi: scsi_transport_srp: Don't block target in failfast state
[ Upstream commit 72eeb7c715 ]
If the port is in SRP_RPORT_FAIL_FAST state when srp_reconnect_rport() is
entered, a transition to SDEV_BLOCK would be illegal, and a kernel WARNING
would be triggered. Skip scsi_target_block() in this case.
Link: https://lore.kernel.org/r/20210111142541.21534-1-mwilck@suse.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
5929bcb4a4
commit
28693cc0fc
@@ -541,7 +541,14 @@ int srp_reconnect_rport(struct srp_rport *rport)
|
|||||||
res = mutex_lock_interruptible(&rport->mutex);
|
res = mutex_lock_interruptible(&rport->mutex);
|
||||||
if (res)
|
if (res)
|
||||||
goto out;
|
goto out;
|
||||||
scsi_target_block(&shost->shost_gendev);
|
if (rport->state != SRP_RPORT_FAIL_FAST)
|
||||||
|
/*
|
||||||
|
* sdev state must be SDEV_TRANSPORT_OFFLINE, transition
|
||||||
|
* to SDEV_BLOCK is illegal. Calling scsi_target_unblock()
|
||||||
|
* later is ok though, scsi_internal_device_unblock_nowait()
|
||||||
|
* treats SDEV_TRANSPORT_OFFLINE like SDEV_BLOCK.
|
||||||
|
*/
|
||||||
|
scsi_target_block(&shost->shost_gendev);
|
||||||
res = rport->state != SRP_RPORT_LOST ? i->f->reconnect(rport) : -ENODEV;
|
res = rport->state != SRP_RPORT_LOST ? i->f->reconnect(rport) : -ENODEV;
|
||||||
pr_debug("%s (state %d): transport.reconnect() returned %d\n",
|
pr_debug("%s (state %d): transport.reconnect() returned %d\n",
|
||||||
dev_name(&shost->shost_gendev), rport->state, res);
|
dev_name(&shost->shost_gendev), rport->state, res);
|
||||||
|
|||||||
Reference in New Issue
Block a user