linux/drivers/nvme/host
Ming Lin b7b9c22787 nvme: fix nvme_ns_remove() deadlock
On receipt of a namespace attribute changed AER, we acquire the
namespace mutex lock before proceeding to scan and validate the
namespace list. In case of namespace detach/delete command,
nvme_ns_remove function deadlocks trying to acquire the already held
lock.

All callers, except nvme_remove_namespaces(), of nvme_ns_remove()
already held namespaces_mutex. So we can simply fix the deadlock by
not acquiring the mutex in nvme_ns_remove() and acquiring it in
nvme_remove_namespaces().

Reported-by: Sunad Bhandary S <sunad.s@samsung.com>
Signed-off-by: Ming Lin <ming.l@ssi.samsung.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimerg <sagi@grimberg.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
2016-05-02 09:16:13 -06:00
..
core.c nvme: fix nvme_ns_remove() deadlock 2016-05-02 09:16:13 -06:00
Kconfig NVMe: small typo in section BLK_DEV_NVME_SCSI of host/Kconfig 2016-04-26 08:31:50 -06:00
lightnvm.c nvme: lightnvm: return ppa completion status 2016-03-18 18:10:38 -07:00
Makefile nvme: split pci module out of core module 2016-02-10 14:22:38 -07:00
nvme.h nvme: add helper nvme_cleanup_cmd() 2016-05-02 09:11:58 -06:00
pci.c nvme: add helper nvme_cleanup_cmd() 2016-05-02 09:11:58 -06:00
scsi.c nvme: move chardev and sysfs interface to common code 2015-12-01 10:59:40 -07:00