linux/drivers/nvme/host
Israel Rukshin b837b28394 nvme: fix subsystem multiple controllers support check
There is a problem when another module (e.g. nvmet) takes a reference on
the nvme block device and the physical nvme drive is removed.  In that
case nvme_free_ctrl() will not be called and the controller state will be
"deleting" or "dead" unless nvmet module releases the block device.
Later on, the same nvme drive probes back and nvme_init_subsystem() will
be called and fail due to duplicate subnqn (if the nvme device doesn't
support subsystem with multiple controllers). This will cause a probe
failure.  This commit changes the check of multiple controllers support
at nvme_init_subsystem() by not counting all the controllers at "dead" or
"deleting" state (this is safe because controllers at this state will
never be active again).

Fixes: ab9e00cc72 ("nvme: track subsystems")
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
Signed-off-by: Israel Rukshin <israelr@mellanox.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2018-01-08 16:57:00 +01:00
..
Kconfig nvme: implement multipath access to nvme subsystems 2017-11-10 19:53:25 -07:00
Makefile Merge branch 'for-4.15/block' of git://git.kernel.dk/linux-block 2017-11-14 15:32:19 -08:00
core.c nvme: fix subsystem multiple controllers support check 2018-01-08 16:57:00 +01:00
fabrics.c nvme-fabrics: protect against module unload during create_ctrl 2018-01-08 11:01:56 +01:00
fabrics.h nvme-fabrics: protect against module unload during create_ctrl 2018-01-08 11:01:56 +01:00
fc.c nvme-fabrics: protect against module unload during create_ctrl 2018-01-08 11:01:56 +01:00
lightnvm.c lightnvm: make geometry structures 2.0 ready 2018-01-05 08:50:12 -07:00
multipath.c nvme: fix spelling mistake: "requeing" -> "requeuing" 2017-11-20 08:38:10 +01:00
nvme.h nvme-pci: fix NULL pointer reference in nvme_alloc_ns 2018-01-08 11:02:13 +01:00
pci.c nvme-pci: fix NULL pointer reference in nvme_alloc_ns 2018-01-08 11:02:13 +01:00
rdma.c nvme-fabrics: protect against module unload during create_ctrl 2018-01-08 11:01:56 +01:00