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

Commit 26871c97 authored by Swen Schillig's avatar Swen Schillig Committed by James Bottomley
Browse files

[SCSI] zfcp: verify for correct rport state before scanning for SCSI devs



Prevent a SCSI target scan for a rport which have turned invalid
in the meantime.

Signed-off-by: default avatarSwen Schillig <swen@vnet.ibm.com>
Signed-off-by: default avatarChristof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 633528c3
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1186,6 +1186,8 @@ static void zfcp_erp_scsi_scan(struct work_struct *work)
		container_of(work, struct zfcp_erp_add_work, work);
	struct zfcp_unit *unit = p->unit;
	struct fc_rport *rport = unit->port->rport;

	if (rport && rport->port_state == FC_PORTSTATE_ONLINE)
		scsi_scan_target(&rport->dev, 0, rport->scsi_target_id,
			 scsilun_to_int((struct scsi_lun *)&unit->fcp_lun), 0);
	atomic_clear_mask(ZFCP_STATUS_UNIT_SCSI_WORK_PENDING, &unit->status);