From: James Bottomley Date: Fri, 19 May 2006 15:49:37 +0000 (-0500) Subject: [SCSI] scsi_transport_sas; fix user_scan X-Git-Tag: v2.6.17-rc6~46^2~2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6d99a3f372181160a56d7b1ee3259dbe03663f0d;p=karo-tx-linux.git [SCSI] scsi_transport_sas; fix user_scan 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 --- diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c index 8b6d65e21bae..8126c395de16 100644 --- a/drivers/scsi/scsi_transport_sas.c +++ b/drivers/scsi/scsi_transport_sas.c @@ -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) &&