lpfc: Fix discovery issue when changing from Pt2Pt to Fabric.
authorJames Smart <james.smart@avagotech.com>
Thu, 21 May 2015 17:55:23 +0000 (13:55 -0400)
committerJames Bottomley <JBottomley@Odin.com>
Sat, 6 Jun 2015 05:37:18 +0000 (22:37 -0700)
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
Signed-off-by: James Smart <james.smart@avagotech.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
drivers/scsi/lpfc/lpfc_hbadisc.c

index e93705da81b4e3555adfa2c2061af7baaa25ab92..0dfa56604c9123dad6531d0bbb9b91e839ff1a90 100644 (file)
@@ -4834,9 +4834,19 @@ lpfc_matchdid(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
        if (matchdid.un.b.id == ndlpdid.un.b.id) {
                if ((mydid.un.b.domain == matchdid.un.b.domain) &&
                    (mydid.un.b.area == matchdid.un.b.area)) {
+                       /* This code is supposed to match the ID
+                        * for a private loop device that is
+                        * connect to fl_port. But we need to
+                        * check that the port did not just go
+                        * from pt2pt to fabric or we could end
+                        * up matching ndlp->nlp_DID 000001 to
+                        * fabric DID 0x20101
+                        */
                        if ((ndlpdid.un.b.domain == 0) &&
                            (ndlpdid.un.b.area == 0)) {
-                               if (ndlpdid.un.b.id)
+                               if (ndlpdid.un.b.id &&
+                                   vport->phba->fc_topology ==
+                                   LPFC_TOPOLOGY_LOOP)
                                        return 1;
                        }
                        return 0;