[SCSI] zfcp: verify for correct rport state before scanning for SCSI devs
authorSwen Schillig <swen@vnet.ibm.com>
Wed, 26 Nov 2008 17:07:38 +0000 (18:07 +0100)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Mon, 1 Dec 2008 16:17:34 +0000 (10:17 -0600)
Prevent a SCSI target scan for a rport which have turned invalid
in the meantime.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/s390/scsi/zfcp_erp.c

index 35364f64da7ff27ce7c740f3bde2a121df3d8556..c55dd2728f907b24af8b8748439a1ca86a62d8dc 100644 (file)
@@ -1186,7 +1186,9 @@ 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;
-       scsi_scan_target(&rport->dev, 0, rport->scsi_target_id,
+
+       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);
        zfcp_unit_put(unit);