1 From: Gerald Schaefer <geraldsc@de.ibm.com>
2 Subject: zfcp: prevent SCSI target scan for vanished rport
3 References: bnc#440610,LTC#49373
5 Symptom: Oops unable to handle ptr dereference
6 Problem: A rport might be referenced eventhough it vanished
7 Solution: Verify that rport is still existant and online
9 Acked-by: John Jolly <jjolly@suse.de>
11 drivers/s390/scsi/zfcp_erp.c | 4 +++-
12 1 file changed, 3 insertions(+), 1 deletion(-)
14 Index: linux-sles11/drivers/s390/scsi/zfcp_erp.c
15 ===================================================================
16 --- linux-sles11.orig/drivers/s390/scsi/zfcp_erp.c
17 +++ linux-sles11/drivers/s390/scsi/zfcp_erp.c
18 @@ -1187,7 +1187,9 @@ static void zfcp_erp_scsi_scan(struct wo
19 container_of(work, struct zfcp_erp_add_work, work);
20 struct zfcp_unit *unit = p->unit;
21 struct fc_rport *rport = unit->port->rport;
22 - scsi_scan_target(&rport->dev, 0, rport->scsi_target_id,
24 + if (rport && rport->port_state == FC_PORTSTATE_ONLINE)
25 + scsi_scan_target(&rport->dev, 0, rport->scsi_target_id,
26 scsilun_to_int((struct scsi_lun *)&unit->fcp_lun), 0);
27 atomic_clear_mask(ZFCP_STATUS_UNIT_SCSI_WORK_PENDING, &unit->status);