From patchwork Fri Nov 3 22:56:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 10041317 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 5248360384 for ; Fri, 3 Nov 2017 22:57:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44B2A299CE for ; Fri, 3 Nov 2017 22:57:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3978E299EB; Fri, 3 Nov 2017 22:57:16 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 E78B7299CE for ; Fri, 3 Nov 2017 22:57:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932281AbdKCW5N (ORCPT ); Fri, 3 Nov 2017 18:57:13 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:57191 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756040AbdKCW4r (ORCPT ); Fri, 3 Nov 2017 18:56:47 -0400 Received: by mail-qt0-f193.google.com with SMTP id z28so5027575qtz.13 for ; Fri, 03 Nov 2017 15:56:47 -0700 (PDT) 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=N5zF1FABNXelFhVkX/YNLJuJUX3kZMn7TDQ57kU1A9A=; b=nj/vO7l1jF3BNUYQuk9B5QzXxaNN3gITDYkBdes+Msy++/XeciOxo7AoZvkvj25+jY 7HW9Tv6JZjIN5mTlFzLbxD+4kLmyPTFl2sTdfXn5hUKO5YvEZDvriz/4LRWWQZn8bS7n iIyBXDaQqHQFo7kxp4lfVb0uJKaaunwigVmSYrM0J8QeDrlvRPaqAZKUDxNbJKtCZegH 8bunB/3iwsT5jBOK+e+/lMLt0j9qhPdA7t8tWAZymTxZbhkEsq0KsR6nEsNBwQtxX9Nv tUnkc8suiBT9iBDHoDJB3Vwp9d3RkT4VO3wMuT03PChWklwSk2FhlEzWsk/fEGRxdwOY Ja4w== 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=N5zF1FABNXelFhVkX/YNLJuJUX3kZMn7TDQ57kU1A9A=; b=ZN84bk5McGpDFKYe4B2yefJJW6KLS7UCgnHbK0I7ArSbgpCmTwClQcjXgEfs1e6vsT KOYPTPT6B27vt2sgKalRijyruYvaOJoLqE9wKOQVSPWtVWdOlkRWzCLB+yxYOlmiZ4Yn LgYwN3ICUwGyu0tu6jhCQT7P3vgzzeUR+dDR+RFsT5Lb191xkzB7+tHmVR+PW0hSUHGJ nR9sr3MJXX4kQKiv5aSwpE2Yh0K9exObdryNiOm3qoAr0saIZaWQIFYVArfjojgUw6I6 E06UwDQG7J8sWCLPHu0p5a8tKlEuRJ54OuDoA/Q4SPjUaBQaecDCGgJGn3Lpfnn7pA/B kbBA== X-Gm-Message-State: AMCzsaUR3IoC5SEfV+DiHQoAMTvxXgV4lLMcHhfqopm4nK22CWaL2x6y 0Si1SDCAWSSjfFBqCVamN058zvD1 X-Google-Smtp-Source: ABhQp+QCZGKyhD2wojaekqqQq3v6hATl7xvDM+RF5t258AnweIfl0bd1r1wFKSp66nPxSjTiEJrITA== X-Received: by 10.237.34.82 with SMTP id o18mr12022183qtc.19.1509749806686; Fri, 03 Nov 2017 15:56:46 -0700 (PDT) Received: from pallmd1.broadcom.com ([192.19.255.250]) by smtp.gmail.com with ESMTPSA id v21sm4765626qtv.21.2017.11.03.15.56.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 Nov 2017 15:56:46 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy , James Smart Subject: [PATCH 10/17] lpfc: Fix ndlp ref count for pt2pt mode issue RSCN Date: Fri, 3 Nov 2017 15:56:21 -0700 Message-Id: <20171103225628.24716-11-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20171103225628.24716-1-jsmart2021@gmail.com> References: <20171103225628.24716-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 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; }