]> Pileus Git - ~andy/linux/commitdiff
[SCSI] zfcp: Add port only once to FC transport class
authorChristof Schmitt <christof.schmitt@de.ibm.com>
Mon, 13 Jul 2009 13:06:11 +0000 (15:06 +0200)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Thu, 30 Jul 2009 13:49:58 +0000 (08:49 -0500)
When calling fc_remote_port_add make sure to not call it again before
fc_remote_port_delete has been called. In other words, ensure to
create a new fc_rport, then delete it, then create a new one again.

Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/s390/scsi/zfcp_scsi.c

index 967ede73f4c57c3ffcbbc12455dd851c7638d744..ba32709921a47df5121d6659da89189d8a4073ae 100644 (file)
@@ -534,6 +534,9 @@ static void zfcp_scsi_rport_register(struct zfcp_port *port)
        struct fc_rport_identifiers ids;
        struct fc_rport *rport;
 
+       if (port->rport)
+               return;
+
        ids.node_name = port->wwnn;
        ids.port_name = port->wwpn;
        ids.port_id = port->d_id;
@@ -557,8 +560,10 @@ static void zfcp_scsi_rport_block(struct zfcp_port *port)
 {
        struct fc_rport *rport = port->rport;
 
-       if (rport)
+       if (rport) {
                fc_remote_port_delete(rport);
+               port->rport = NULL;
+       }
 }
 
 void zfcp_scsi_schedule_rport_register(struct zfcp_port *port)