]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
nvme: Skip checking heads without namespaces
authorKeith Busch <keith.busch@intel.com>
Mon, 19 Mar 2018 16:53:50 +0000 (10:53 -0600)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 22 May 2018 14:18:32 +0000 (16:18 +0200)
commitef7ba5935c48fad738d9839aca5df3f5ce9bf8c6
tree2331b067f76cd90b9000f46272d3199f4c7de9c4
parent1f8c70198212c497ca98cd4466b0cfb049a8832d
nvme: Skip checking heads without namespaces

BugLink: http://bugs.launchpad.net/bugs/1769723
commit 2079699c10c8c60a9572540c2f77d045abf036eb upstream.

If a task is holding a reference to a namespace on a removed controller,
the head will not be released. If the same controller is added again
later, its namespaces may not be successfully added. Instead, the user
will see kernel message "Duplicate IDs for nsid <X>".

This patch fixes that by skipping heads that don't have namespaces when
considering if a new namespace is safe to add.

Reported-by: Alex Gagniuc <Alex_Gagniuc@Dellteam.com>
Cc: stable@vger.kernel.org
Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/nvme/host/core.c