Skip to content

Commit 675195d

Browse files
Hannes Reineckemartinkpetersen
authored andcommitted
scsi: scsi_transport_fc: set scsi_target_id upon rescan
When an rport is found in the bindings array there is no guarantee that it had been a target port, so we need to call fc_remote_port_rolechg() here to ensure the scsi_target_id is set correctly. Otherwise the port will never be scanned. Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Tested-by: Chad Dupuis <chad.dupuis@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent c88f0e6 commit 675195d

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

drivers/scsi/scsi_transport_fc.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2876,7 +2876,6 @@ fc_remote_port_add(struct Scsi_Host *shost, int channel,
28762876
memcpy(&rport->port_name, &ids->port_name,
28772877
sizeof(rport->port_name));
28782878
rport->port_id = ids->port_id;
2879-
rport->roles = ids->roles;
28802879
rport->port_state = FC_PORTSTATE_ONLINE;
28812880
rport->flags &= ~FC_RPORT_FAST_FAIL_TIMEDOUT;
28822881

@@ -2885,15 +2884,7 @@ fc_remote_port_add(struct Scsi_Host *shost, int channel,
28852884
fci->f->dd_fcrport_size);
28862885
spin_unlock_irqrestore(shost->host_lock, flags);
28872886

2888-
if (ids->roles & FC_PORT_ROLE_FCP_TARGET) {
2889-
scsi_target_unblock(&rport->dev, SDEV_RUNNING);
2890-
2891-
/* initiate a scan of the target */
2892-
spin_lock_irqsave(shost->host_lock, flags);
2893-
rport->flags |= FC_RPORT_SCAN_PENDING;
2894-
scsi_queue_work(shost, &rport->scan_work);
2895-
spin_unlock_irqrestore(shost->host_lock, flags);
2896-
}
2887+
fc_remote_port_rolechg(rport, ids->roles);
28972888
return rport;
28982889
}
28992890
}

0 commit comments

Comments
 (0)