From: Hannes Reinecke Subject: Re: [PATCH 10/17] lpfc: Fix ndlp ref count for pt2pt mode issue RSCN Date: Mon, 20 Nov 2017 14:16:34 +0100 Message-ID: <86c98fa0-7c2f-f594-aabe-4a712db6627d@suse.de> References: <20171103225628.24716-1-jsmart2021@gmail.com> <20171103225628.24716-11-jsmart2021@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from mx2.suse.de ([195.135.220.15]:56224 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751106AbdKTNQh (ORCPT ); Mon, 20 Nov 2017 08:16:37 -0500 In-Reply-To: <20171103225628.24716-11-jsmart2021@gmail.com> Content-Language: en-US Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: James Smart , linux-scsi@vger.kernel.org Cc: Dick Kennedy , James Smart On 11/03/2017 11:56 PM, James Smart wrote: > pt2pt ndlp ref count prematurely goes to 0. There was reference > removed that should only be removed if connected to a switch, > not if in point-to-point mode. > > Add a mode check before the reference remove. > > Signed-off-by: Dick Kennedy > Signed-off-by: James Smart > --- > drivers/scsi/lpfc/lpfc_els.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c > index 95872a0329ad..a708d80cb609 100644 > --- a/drivers/scsi/lpfc/lpfc_els.c > +++ b/drivers/scsi/lpfc/lpfc_els.c > @@ -2962,8 +2962,8 @@ lpfc_issue_els_scr(struct lpfc_vport *vport, uint32_t nportid, uint8_t retry) > /* This will cause the callback-function lpfc_cmpl_els_cmd to > * trigger the release of node. > */ > - > - lpfc_nlp_put(ndlp); > + if (!(vport->fc_flag & FC_PT2PT)) > + lpfc_nlp_put(ndlp); > return 0; > } > > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg)