From patchwork Tue Nov 21 00:00:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 10067517 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 C11236056A for ; Tue, 21 Nov 2017 00:01:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B28BA29194 for ; Tue, 21 Nov 2017 00:01:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A77FC2923B; Tue, 21 Nov 2017 00:01:24 +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 613A729194 for ; Tue, 21 Nov 2017 00:01:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752015AbdKUABX (ORCPT ); Mon, 20 Nov 2017 19:01:23 -0500 Received: from mail-qt0-f194.google.com ([209.85.216.194]:33365 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751526AbdKUABF (ORCPT ); Mon, 20 Nov 2017 19:01:05 -0500 Received: by mail-qt0-f194.google.com with SMTP id r58so17034026qtc.0 for ; Mon, 20 Nov 2017 16:01:04 -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=vC7LaEZeI1iVRy2P/IoWCwE8XLSF1+Wg6d4OqvbIEMI=; b=og8UrwSKBgX9ev6+Zb84EKmuNaVVEoj+zqj5DutYMu2TO4q+7H97ZXdUUkUsbHnb9r 3Tk59sHTxQyySgMbqnWckJ2kAbO7Gm24eEn/8APAe/fh1OOK1FjU65iHS/eFiwCqTW9B R+hhtFCxrQmh9NFJRY1kAdZdQZ5pP68KwGg91thJSTAWoaAjPN5/WF9Tie1GCAgFA1ZN ueekJoS6K0iibtEko1SyvNFrGr4O6j9oxZkpwqFflLpXqQt8WMcCqHje+voPm9+AIrp4 C0lkvEqvVAZj2OlJXZqQudlDqo0eYrZfEgOGy07sEdzte27hK0xf4XK/QsFSm0bsh9u8 XfNg== 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=vC7LaEZeI1iVRy2P/IoWCwE8XLSF1+Wg6d4OqvbIEMI=; b=WjJ0dvwUnR+JqzLyx0gGkFetsMpzlYz7FR+enNZt1uOpimg/pc5fldgqugqy1LC4Qc o8cABVCCd/tTWcQUGfEP0iSVzNf7fWlspB3EGcqRXC/n+vcv9xs7OztakLULdtenrpgU hoW/hwltQCZpKF01BZVwpVEeHJTzfkd9IVxQVLpWkbUVmy8pt0C+aFwK+p7P3jY2glmM gQCeVXRrIVeioxE7w+xKlgDhmGPvG9bGfAaO3zS2K6Ua7HAXVNE9AlW6KlJqsXHXib8Z AtW3xOnBwcJ2/TCJ9XN7GjUfIxOJI2n/6YFQGZRv3kKrvrdVQ6dk6+PVqXQ76J263HD4 oCPw== X-Gm-Message-State: AJaThX7A7YlpVMgqru6Vm0vEmosp8vuqpjPZ2bz7iT0qnPnX1vls7cKN Ak9c2V3qbV/SIIhpPPThZB+YcjW1 X-Google-Smtp-Source: AGs4zMagWU/E3Zls1y3bzekQmfDwAVhGSZBHEelHHm4C/q22fi1P0YKilyKn6Mm+JgHgQkt5LOejmg== X-Received: by 10.200.42.14 with SMTP id k14mr23476338qtk.20.1511222464450; Mon, 20 Nov 2017 16:01:04 -0800 (PST) Received: from pallmd1.broadcom.com ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id w143sm1612821qka.84.2017.11.20.16.01.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 Nov 2017 16:01:04 -0800 (PST) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy , James Smart Subject: [PATCH v3 10/17] lpfc: Fix ndlp ref count for pt2pt mode issue RSCN Date: Mon, 20 Nov 2017 16:00:37 -0800 Message-Id: <20171121000044.27702-11-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20171121000044.27702-1-jsmart2021@gmail.com> References: <20171121000044.27702-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; }