From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christof Schmitt Subject: [patch 10/13] zfcp: Add port only once to FC transport class Date: Mon, 13 Jul 2009 15:06:11 +0200 Message-ID: <20090713131043.985315000@de.ibm.com> References: <20090713130601.304914000@de.ibm.com> Return-path: Content-Disposition: inline; filename=716-zfcp-add-port-once.diff Sender: linux-scsi-owner@vger.kernel.org List-Archive: List-Post: To: James Bottomley Cc: linux-scsi@vger.kernel.org, linux-s390@vger.kernel.org, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, Christof Schmitt List-ID: From: Christof Schmitt 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 Signed-off-by: Christof Schmitt --- drivers/s390/scsi/zfcp_scsi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/drivers/s390/scsi/zfcp_scsi.c 2009-07-13 13:18:07.000000000 +0200 +++ b/drivers/s390/scsi/zfcp_scsi.c 2009-07-13 13:18:14.000000000 +0200 @@ -534,6 +534,9 @@ static void zfcp_scsi_rport_register(str 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 { 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)