From patchwork Fri Sep 22 06:17:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 9965227 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 7803D602D8 for ; Fri, 22 Sep 2017 06:18:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6500729708 for ; Fri, 22 Sep 2017 06:18:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 59C9029711; Fri, 22 Sep 2017 06:18:14 +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 F24BF29708 for ; Fri, 22 Sep 2017 06:18:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751887AbdIVGSM (ORCPT ); Fri, 22 Sep 2017 02:18:12 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:34610 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751879AbdIVGSI (ORCPT ); Fri, 22 Sep 2017 02:18:08 -0400 Received: by mail-pg0-f67.google.com with SMTP id u18so126701pgo.1 for ; Thu, 21 Sep 2017 23:18:07 -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=x3CSmVzrU0ajBAbct2MjDQxfiRJvjPSO2YYHMDTJKQk=; b=Rjko/w9LUijrPPWpUm4NAKCwns0zw9rn6erx51oT7zhqUjDGLcut+/wEDYiA5xoFhj pLLzWKBRuhXSv3jgiRGVnM0DYz5CfXwEfbT/gz4tr5fdU1jJHqWHQTKYYCtZx9rgbzTC hajjKXXS51ixkNGzWiNXoXKZyBT422XGXgMe6lsm37jWMRjji5k5JYo65a9hJaKcJKee wml+gT5wL5658MEIKVxOb6gB9UbCxCFP9N0BrImSmh4m7Ydh7NqNLVKCUL/8XILVVt9M 9cX6wyQaNNESptKfv/+l4ycm247IBOcS2jNJgv+cS1VOLBfUiICPCRHV+f9rF4vRQWUb GCkQ== 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=x3CSmVzrU0ajBAbct2MjDQxfiRJvjPSO2YYHMDTJKQk=; b=uMmLq+pFAeddjR3U7rjOZ9pmBo9Qx2hvulV7WQbK5mM+DZdZvNVHZZoA80xoPfzcXC /557yg8zbTkbYjatN4uNdLRWXPwJb1/OsXu4eigDdpC/Rs4WpHTXiZ3dLg+y9o/k5lWf k9gPZlFAMurM+DtVp13BhpUolTYp8Y8SRQBQSIsc6kWNBucYbYt8FScH9xL+dMYYfFDE I9yArBZtkU/keJEDTJ+laCX/bXFY5rGp+yNFkRDAwgJVPvMSQ8RlVYUL06LeeF25Hjvx 4LMEgeKtxKOvapNWtRGJJi6BbW6icCZczyKBWiNg10MU/qx9GbP/2gsrnSswKNVeFXWx UMyA== X-Gm-Message-State: AHPjjUjR/wc1CWk4YI73V+7STomYSed3kKGVCAGnqyvJSBUHaAv5g4XS AZ9d6L1vbNjvs83CU0bGuVG/aA== X-Google-Smtp-Source: AOwi7QB+7nn9yHk7sM321kV6E/bth8+ooUshIhsdMwhFeUagaYjrspVH7IqWXSrZkJ6jZvrAcTwISw== X-Received: by 10.98.200.76 with SMTP id z73mr8255470pff.154.1506061087466; Thu, 21 Sep 2017 23:18:07 -0700 (PDT) Received: from os42.localdomain (ip68-4-115-207.oc.oc.cox.net. [68.4.115.207]) by smtp.gmail.com with ESMTPSA id e87sm5911355pfl.46.2017.09.21.23.18.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Sep 2017 23:18:06 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: Dick Kennedy , James Smart Subject: [PATCH 12/19] lpfc: Fix oops if nvmet_fc_register_targetport fails Date: Thu, 21 Sep 2017 23:17:34 -0700 Message-Id: <20170922061741.12347-13-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170922061741.12347-1-jsmart2021@gmail.com> References: <20170922061741.12347-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 From: Dick Kennedy if nvmet targetport registration fails, the driver encounters a NULL pointer oops in lpfc_hb_timeout_handler. To fix: if registration fails, ensure nvmet_support is cleared on the port structure. Also enhanced the log message on failure. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewed-by: Johannes Thumshirn --- drivers/scsi/lpfc/lpfc_nvmet.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_nvmet.c b/drivers/scsi/lpfc/lpfc_nvmet.c index ee88343f3e8c..55badeace591 100644 --- a/drivers/scsi/lpfc/lpfc_nvmet.c +++ b/drivers/scsi/lpfc/lpfc_nvmet.c @@ -1172,9 +1172,14 @@ lpfc_nvmet_create_targetport(struct lpfc_hba *phba) #endif if (error) { lpfc_printf_log(phba, KERN_ERR, LOG_NVME_DISC, - "6025 Cannot register NVME targetport " - "x%x\n", error); + "6025 Cannot register NVME targetport x%x: " + "portnm %llx nodenm %llx segs %d qs %d\n", + error, + pinfo.port_name, pinfo.node_name, + lpfc_tgttemplate.max_sgl_segments, + lpfc_tgttemplate.max_hw_queues); phba->targetport = NULL; + phba->nvmet_support = 0; lpfc_nvmet_cleanup_io_context(phba); @@ -1186,9 +1191,11 @@ lpfc_nvmet_create_targetport(struct lpfc_hba *phba) lpfc_printf_log(phba, KERN_INFO, LOG_NVME_DISC, "6026 Registered NVME " "targetport: %p, private %p " - "portnm %llx nodenm %llx\n", + "portnm %llx nodenm %llx segs %d qs %d\n", phba->targetport, tgtp, - pinfo.port_name, pinfo.node_name); + pinfo.port_name, pinfo.node_name, + lpfc_tgttemplate.max_sgl_segments, + lpfc_tgttemplate.max_hw_queues); atomic_set(&tgtp->rcv_ls_req_in, 0); atomic_set(&tgtp->rcv_ls_req_out, 0);