Bug fix - Due to a recent change in scsi_transport_sas, in the function sas_rphy_add(), its possible to have the same target mapped to two different device nodes, meaning /dev/sda at id=0 and /dev/sdb at id=1, are remapped in mptsas to the same device at id=foo. I'll explain the problem. The sas drivers have a rphy to rphy relationship. An rphy created on a hba phy points to the expander phy. Then the expander phy creates a rphy pointing back to the same hba rphy. The expander phy which contains the rphy pointing back to the hba phy, contains the attributes device_type = SAS_END_DEVICE, and target_port_protocals = 0. Hence the recent change in sas_rphy_add() make it drop down to scsi_scan_target, whereas before there was sepecial handling to prevent this case from happening. With this change, the mptsas slave entry points are called to enumerate the rphy that points back to the hba phy. The target id in our data structures is the same as a real target device on another phy. Thus we end up mapping the same target to two different rphys. To fix this, I added a check in mptsas_slave_alloc to make sure the requested rphy is mapped to a true end device. JEJB: Pls apply to scsi-rc-fixes tree. Signed-off-by: Eric Moore <Eric.Moore@xxxxxxxx>
Attachment:
duplicate_targets.patch
Description: duplicate_targets.patch