nvme: fixup crash on failed discovery
PATCH 1/1 nvme: fixup crash on failed discovery
When the initial discovery fails the subsystem hasn't been setup, and we'll encounter a kernel oops during shutdown.
--- drivers/nvme/host/multipath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/multipath.c +1 -1
@@ -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 )); }/*
Signature · 1 line
2.12.3
Christoph Hellwig
maintainerPATCH 1/1 nvme: fixup crash on failed discovery
Quoted 2 lines · Hannes Reinecke
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.
PATCH 1/1 nvme: fixup crash on failed discovery
Quoted 7 lines · Christoph Hellwig
Quoted 2 lines · Hannes Reinecke
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_anaif 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
Signature · 5 lines
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)
Christoph Hellwig
maintainerPATCH 1/1 nvme: fixup crash on failed discovery
Quoted 11 lines · Hannes Reinecke
Quoted 7 lines · Christoph Hellwig
Quoted 2 lines · Hannes Reinecke
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_anaif 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.