All of lore.kernel.org
 help / color / mirror / Atom feed
From: jthumshirn@suse.de (Johannes Thumshirn)
Subject: [PATCH-v1 13/22] Fix nvme initiator handling when not enabled.
Date: Thu, 20 Apr 2017 09:38:57 +0200	[thread overview]
Message-ID: <20170420073857.GN6217@linux-x5ow.site> (raw)
In-Reply-To: <20170420044641.10657-14-jsmart2021@gmail.com>

On Wed, Apr 19, 2017@09:46:32PM -0700, jsmart2021@gmail.com wrote:
> From: James Smart <jsmart2021 at gmail.com>
> 
> Fix nvme initiator handline when CONFIG_LPFC_NVME_INITIATOR is not enabled.
> 
> With update nvme upstream driver sources, loading
> the driver with nvme enabled resulting in this Oops.
> 
>  BUG: unable to handle kernel NULL pointer dereference at 0000000000000018
>  IP: lpfc_nvme_update_localport+0x23/0xd0 [lpfc]
>  PGD 0
>  Oops: 0000 [#1] SMP
>  CPU: 0 PID: 10256 Comm: lpfc_worker_0 Tainted
>  Hardware name: ...
>  task: ffff881028191c40 task.stack: ffff880ffdf00000
>  RIP: 0010:lpfc_nvme_update_localport+0x23/0xd0 [lpfc]
>  RSP: 0018:ffff880ffdf03c20 EFLAGS: 00010202
> 
> Cause: As the initiator driver completes discovery at different stages,
> it call lpfc_nvme_update_localport to hint that the DID and role may have
> changed.  In the implementation of lpfc_nvme_update_localport, the driver
> was not validating the localport or the lport during the execution
> of the update_localport routine.  With the recent upstream additions to
> the driver, the create_localport routine didn't run and so the localport
> was NULL causing the page-fault Oops.
> 
> Fix: Add the CONFIG_LPFC_NVME_INITIATOR preprocessor inclusions to
> lpfc_nvme_update_localport to turn off all routine processing when
> the running kernel does not have NVME configured.  Add NULL pointer
> checks on the localport and lport in lpfc_nvme_update_localport and
> dump messages if they are NULL and just exit.
> Also one alingment issue fixed.
> Repalces the ifdef with the IS_ENABLED macro.
> 
> Signed-off-by: Dick Kennedy <dick.kennedy at broadcom.com>
> Signed-off-by: James Smart <james.smart at broadcom.com>
> ---

Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>
-- 
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

WARNING: multiple messages have this Message-ID (diff)
From: Johannes Thumshirn <jthumshirn@suse.de>
To: jsmart2021@gmail.com
Cc: linux-scsi@vger.kernel.org, linux-nvme@lists.infradead.org,
	sagi@grimberg.me, martin.petersen@oracle.com,
	Dick Kennedy <dick.kennedy@broadcom.com>,
	James Smart <james.smart@broadcom.com>
Subject: Re: [PATCH-v1 13/22] Fix nvme initiator handling when not enabled.
Date: Thu, 20 Apr 2017 09:38:57 +0200	[thread overview]
Message-ID: <20170420073857.GN6217@linux-x5ow.site> (raw)
In-Reply-To: <20170420044641.10657-14-jsmart2021@gmail.com>

On Wed, Apr 19, 2017 at 09:46:32PM -0700, jsmart2021@gmail.com wrote:
> From: James Smart <jsmart2021@gmail.com>
> 
> Fix nvme initiator handline when CONFIG_LPFC_NVME_INITIATOR is not enabled.
> 
> With update nvme upstream driver sources, loading
> the driver with nvme enabled resulting in this Oops.
> 
>  BUG: unable to handle kernel NULL pointer dereference at 0000000000000018
>  IP: lpfc_nvme_update_localport+0x23/0xd0 [lpfc]
>  PGD 0
>  Oops: 0000 [#1] SMP
>  CPU: 0 PID: 10256 Comm: lpfc_worker_0 Tainted
>  Hardware name: ...
>  task: ffff881028191c40 task.stack: ffff880ffdf00000
>  RIP: 0010:lpfc_nvme_update_localport+0x23/0xd0 [lpfc]
>  RSP: 0018:ffff880ffdf03c20 EFLAGS: 00010202
> 
> Cause: As the initiator driver completes discovery at different stages,
> it call lpfc_nvme_update_localport to hint that the DID and role may have
> changed.  In the implementation of lpfc_nvme_update_localport, the driver
> was not validating the localport or the lport during the execution
> of the update_localport routine.  With the recent upstream additions to
> the driver, the create_localport routine didn't run and so the localport
> was NULL causing the page-fault Oops.
> 
> Fix: Add the CONFIG_LPFC_NVME_INITIATOR preprocessor inclusions to
> lpfc_nvme_update_localport to turn off all routine processing when
> the running kernel does not have NVME configured.  Add NULL pointer
> checks on the localport and lport in lpfc_nvme_update_localport and
> dump messages if they are NULL and just exit.
> Also one alingment issue fixed.
> Repalces the ifdef with the IS_ENABLED macro.
> 
> Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
> Signed-off-by: James Smart <james.smart@broadcom.com>
> ---

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

  reply	other threads:[~2017-04-20  7:38 UTC|newest]

Thread overview: 100+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-20  4:46 [PATCH-v1 00/22] lpfc updates for 11.2.0.12 jsmart2021
2017-04-20  4:46 ` jsmart2021
2017-04-20  4:46 ` [PATCH-v1 01/22] Standardize nvme SGL segment count jsmart2021
2017-04-20  4:46   ` jsmart2021
2017-04-20  7:15   ` Johannes Thumshirn
2017-04-20  7:15     ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 02/22] Fix nvme unregister port timeout jsmart2021
2017-04-20  4:46   ` jsmart2021
2017-04-20  7:15   ` Johannes Thumshirn
2017-04-20  7:15     ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 03/22] Fix rejected nvme LS Req jsmart2021
2017-04-20  4:46   ` jsmart2021
2017-04-20  7:29   ` Johannes Thumshirn
2017-04-20  7:29     ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 04/22] Fix log message in completion path jsmart2021
2017-04-20  4:46   ` jsmart2021
2017-04-20  7:32   ` Johannes Thumshirn
2017-04-20  7:32     ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 05/22] Add debug messages for nvme/fcp resource allocation jsmart2021
2017-04-20  4:46   ` jsmart2021
2017-04-20  7:33   ` Johannes Thumshirn
2017-04-20  7:33     ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 06/22] Fix spelling in comments jsmart2021
2017-04-20  4:46   ` jsmart2021
2017-04-20  7:34   ` Johannes Thumshirn
2017-04-20  7:34     ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 07/22] Remove unused defines for NVME PostBuf jsmart2021
2017-04-20  4:46   ` jsmart2021
2017-04-20  7:34   ` Johannes Thumshirn
2017-04-20  7:34     ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 08/22] Remove NULL ptr check before kfree jsmart2021
2017-04-20  4:46   ` jsmart2021
2017-04-20  7:34   ` Johannes Thumshirn
2017-04-20  7:34     ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 09/22] Fix extra line print in rqpair debug print jsmart2021
2017-04-20  4:46   ` jsmart2021
2017-04-20  7:35   ` Johannes Thumshirn
2017-04-20  7:35     ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 10/22] Fix PRLI ACC rsp for NVME jsmart2021
2017-04-20  4:46   ` jsmart2021
2017-04-20  7:35   ` Johannes Thumshirn
2017-04-20  7:35     ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 11/22] Fix driver unload/reload operation jsmart2021
2017-04-20  4:46   ` jsmart2021
2017-04-20  7:37   ` Johannes Thumshirn
2017-04-20  7:37     ` Johannes Thumshirn
2017-04-20  9:08     ` Junichi Nomura
2017-04-20  9:08       ` Junichi Nomura
2017-04-20  4:46 ` [PATCH-v1 12/22] Fix driver usage of 128B WQEs when WQ_CREATE is V1 jsmart2021
2017-04-20  4:46   ` jsmart2021
2017-04-20  7:37   ` Johannes Thumshirn
2017-04-20  7:37     ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 13/22] Fix nvme initiator handling when not enabled jsmart2021
2017-04-20  4:46   ` jsmart2021
2017-04-20  7:38   ` Johannes Thumshirn [this message]
2017-04-20  7:38     ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 14/22] Remove hba lock from NVMET issue WQE jsmart2021
2017-04-20  4:46   ` jsmart2021
2017-04-20  7:40   ` Johannes Thumshirn
2017-04-20  7:40     ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 15/22] Fix driver load issues when MRQ=8 jsmart2021
2017-04-20  4:46   ` jsmart2021
2017-04-20  7:42   ` Johannes Thumshirn
2017-04-20  7:42     ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 16/22] Fix crash after issuing lip reset jsmart2021
2017-04-20  4:46   ` jsmart2021
2017-04-20  7:42   ` Johannes Thumshirn
2017-04-20  7:42     ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 17/22] Fix max_sgl_segments settings for NVME / NVMET jsmart2021
2017-04-20  4:46   ` jsmart2021
2017-04-20  4:46 ` [PATCH-v1 18/22] Add Fabric assigned WWN support jsmart2021
2017-04-20  4:46   ` jsmart2021
2017-04-20  7:49   ` Johannes Thumshirn
2017-04-20  7:49     ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 19/22] Fix implicit logo and RSCN handling for NVMET jsmart2021
2017-04-20  4:46   ` jsmart2021
2017-04-20  7:53   ` Johannes Thumshirn
2017-04-20  7:53     ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 20/22] Update ABORT processing " jsmart2021
2017-04-20  4:46   ` jsmart2021
2017-04-20  8:10   ` Johannes Thumshirn
2017-04-20  8:10     ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 21/22] Fix Express lane queue creation jsmart2021
2017-04-20  4:46   ` jsmart2021
2017-04-20  8:11   ` Johannes Thumshirn
2017-04-20  8:11     ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 22/22] lpfc revison 11.2.0.12 jsmart2021
2017-04-20  4:46   ` jsmart2021
2017-04-20  8:11   ` Johannes Thumshirn
2017-04-20  8:11     ` Johannes Thumshirn
2017-04-20 18:30 ` [PATCH-v1 00/22] lpfc updates for 11.2.0.12 Jens Axboe
2017-04-20 18:30   ` Jens Axboe
2017-04-20 18:54   ` James Smart
2017-04-20 18:54     ` James Smart
2017-04-21  7:00   ` Johannes Thumshirn
2017-04-21  7:00     ` Johannes Thumshirn
2017-04-21 11:24     ` Martin K. Petersen
2017-04-21 11:24       ` Martin K. Petersen
2017-04-21 16:41       ` James Smart
2017-04-21 16:41         ` James Smart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170420073857.GN6217@linux-x5ow.site \
    --to=jthumshirn@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.