Skip to content

Commit

Permalink
[SCSI] scsi_transport_sas; fix user_scan
Browse files Browse the repository at this point in the history
the user_scan() callback currently has the potential to identify the
wrong device in the presence of expanders.  This is because it finds
the first device with a matching target_id, which might be an
expander.  Fix this by making it look specifically for end devices.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
  • Loading branch information
James Bottomley authored and James Bottomley committed May 20, 2006
1 parent 78a904b commit 6d99a3f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/scsi/scsi_transport_sas.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,8 @@ static int sas_user_scan(struct Scsi_Host *shost, uint channel,
list_for_each_entry(rphy, &sas_host->rphy_list, list) {
struct sas_phy *parent = dev_to_phy(rphy->dev.parent);

if (rphy->scsi_target_id == -1)
if (rphy->identify.device_type != SAS_END_DEVICE ||
rphy->scsi_target_id == -1)
continue;

if ((channel == SCAN_WILD_CARD || channel == parent->port_identifier) &&
Expand Down

0 comments on commit 6d99a3f

Please sign in to comment.