From patchwork Fri Nov 10 01:08:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 10052223 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 37BCA6032D for ; Fri, 10 Nov 2017 01:09:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B4552B225 for ; Fri, 10 Nov 2017 01:09:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1FF432B228; Fri, 10 Nov 2017 01:09:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFDD72B225 for ; Fri, 10 Nov 2017 01:09:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755544AbdKJBI7 (ORCPT ); Thu, 9 Nov 2017 20:08:59 -0500 Received: from mail-qk0-f193.google.com ([209.85.220.193]:47624 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755523AbdKJBIx (ORCPT ); Thu, 9 Nov 2017 20:08:53 -0500 Received: by mail-qk0-f193.google.com with SMTP id m189so10117935qke.4 for ; Thu, 09 Nov 2017 17:08:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=U+bPKU/by661+Blj8YT3UPx4s/RuDFsWy+FBFBGwDfU=; b=of8YehDilbHQpALEzyRQUqIT3el/DyHTar2SjBU40bzjmgP7RRL/Zw7RVLhFC0rv0h 61wvGhZDUVoGfgTr2b5YrHbVzMWo78qkB7Ls2nDTMa6DTna4d0OjCC5Psgmc4/9To5eY 6tb87HqJL+P6y7ZH3le3AMvdXhSrhUlSEbljnJ04ByIB5muf/rahQjZYw2V/dLp+UF9a puJBmG4ImyoKUxLnZCOCKIB35UP5+XUci8kROijGMaBrKCb4/nnWzVW3PTR2ufBSIt7k dPAHhxHtpVvFAGICxzmqAVNKdS8TnDUHVSgRoTO6JMSPfiZ56zDxgqoGjInRNEuDK6fu ybKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=U+bPKU/by661+Blj8YT3UPx4s/RuDFsWy+FBFBGwDfU=; b=bw87Ye8h9SQIJGsc3bfl/icM2k6uoNA3qC2TvidJKCPQ6xxBgJI3PYH3xcWhOkhetv e/HtGnNagjfKZUOylspF+yY0k/MB4DNuCH7gkiKS3L2y2m6M3ehz2Fu18hrbj+gYYgVt uPbnB9Znk3ubZcqccErQOsOSIgO/7jnPt7vwjK5PM2F1IasniNvMsYeBxOIczuCkAOH0 Az1V5f9QVoMwbVM7QbnAjuBc2CSvuPel9fbDg4DvpfWVdHVe7WmBuw75vODi94Aa0Gv6 utMwbsQiyUSppFM0itEHX6yBz7JM0zR6/gKbxtexXvt23AhEfSVLj3HF5u8OhogjvEBj nDCw== X-Gm-Message-State: AJaThX6No9XPq4aRVPhzeg95zUWobcrgPJvLBCJ+AjKDt88N0S953h2X YrxwghiADyF2PfnJJYuYvE9RyYb3 X-Google-Smtp-Source: AGs4zMbgD+YaFLUcrHkGQMZfEd03DnGL2q7YR/AfCcBDh9b1/FUpiV0X2UGxeoFlnISMkcg4wuYLbA== X-Received: by 10.233.216.199 with SMTP id u190mr3784922qkf.203.1510276132645; Thu, 09 Nov 2017 17:08:52 -0800 (PST) Received: from pallmd1.broadcom.com ([192.19.255.250]) by smtp.gmail.com with ESMTPSA id j48sm5661969qta.96.2017.11.09.17.08.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Nov 2017 17:08:52 -0800 (PST) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy , James Smart Subject: [PATCH v2 10/17] lpfc: Fix ndlp ref count for pt2pt mode issue RSCN Date: Thu, 9 Nov 2017 17:08:27 -0800 Message-Id: <20171110010834.4542-11-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20171110010834.4542-1-jsmart2021@gmail.com> References: <20171110010834.4542-1-jsmart2021@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Hannes Reinecke --- 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 532cd4b49c5d..911066c9612d 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -2956,8 +2956,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; }