* [PATCH] nvme: fixup crash on failed discovery
@ 2018-08-07 10:43 Hannes Reinecke
2018-08-07 11:46 ` Christoph Hellwig
0 siblings, 1 reply; 4+ messages in thread
From: Hannes Reinecke @ 2018-08-07 10:43 UTC (permalink / raw)
When the initial discovery fails the subsystem hasn't been setup,
and we'll encounter a kernel oops during shutdown.
Signed-off-by: Hannes Reinecke <hare at suse.com>
---
drivers/nvme/host/multipath.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index 420efcda33d9..c1f41aa879c1 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -24,7 +24,7 @@ MODULE_PARM_DESC(multipath,
inline bool nvme_ctrl_use_ana(struct nvme_ctrl *ctrl)
{
- return multipath && (ctrl->subsys->cmic & (1 << 3));
+ return multipath && ctrl->subsys && (ctrl->subsys->cmic & (1 << 3));
}
/*
--
2.12.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] nvme: fixup crash on failed discovery
2018-08-07 10:43 [PATCH] nvme: fixup crash on failed discovery Hannes Reinecke
@ 2018-08-07 11:46 ` Christoph Hellwig
2018-08-07 12:01 ` Hannes Reinecke
0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2018-08-07 11:46 UTC (permalink / raw)
On Tue, Aug 07, 2018@12:43:42PM +0200, Hannes Reinecke wrote:
> When the initial discovery fails the subsystem hasn't been setup,
> and we'll encounter a kernel oops during shutdown.
This looks ok, but I'm curious where we even call nvme_ctrl_use_ana
if we fail early.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] nvme: fixup crash on failed discovery
2018-08-07 11:46 ` Christoph Hellwig
@ 2018-08-07 12:01 ` Hannes Reinecke
2018-08-07 12:47 ` Christoph Hellwig
0 siblings, 1 reply; 4+ messages in thread
From: Hannes Reinecke @ 2018-08-07 12:01 UTC (permalink / raw)
On 08/07/2018 01:46 PM, Christoph Hellwig wrote:
> On Tue, Aug 07, 2018@12:43:42PM +0200, Hannes Reinecke wrote:
>> When the initial discovery fails the subsystem hasn't been setup,
>> and we'll encounter a kernel oops during shutdown.
>
> This looks ok, but I'm curious where we even call nvme_ctrl_use_ana
> if we fail early.
>
This is called via
nvme_sysfs_delete()->nvme_ctrl_delete()->nvme_stop_ctrl()->nvme_mpath_stop()
called from 'nvme discover' on a failing controller.
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare at suse.com +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: F. Imend?rffer, J. Smithard, D. Upmanyu, G. Norton
HRB 21284 (AG N?rnberg)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] nvme: fixup crash on failed discovery
2018-08-07 12:01 ` Hannes Reinecke
@ 2018-08-07 12:47 ` Christoph Hellwig
0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2018-08-07 12:47 UTC (permalink / raw)
On Tue, Aug 07, 2018@02:01:09PM +0200, Hannes Reinecke wrote:
> On 08/07/2018 01:46 PM, Christoph Hellwig wrote:
> > On Tue, Aug 07, 2018@12:43:42PM +0200, Hannes Reinecke wrote:
> >> When the initial discovery fails the subsystem hasn't been setup,
> >> and we'll encounter a kernel oops during shutdown.
> >
> > This looks ok, but I'm curious where we even call nvme_ctrl_use_ana
> > if we fail early.
> >
> This is called via
> nvme_sysfs_delete()->nvme_ctrl_delete()->nvme_stop_ctrl()->nvme_mpath_stop()
> called from 'nvme discover' on a failing controller.
Thanks. Applied with a slightly updated changelog.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-08-07 12:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-07 10:43 [PATCH] nvme: fixup crash on failed discovery Hannes Reinecke
2018-08-07 11:46 ` Christoph Hellwig
2018-08-07 12:01 ` Hannes Reinecke
2018-08-07 12:47 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox