nvme: release namespace SRCU protection before performing controller ioctls
authorChristoph Hellwig <hch@lst.de>
Fri, 17 May 2019 09:47:36 +0000 (11:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Jun 2019 06:18:03 +0000 (08:18 +0200)
commitddda7e850bf10302b0bb6036dde40e60d8377f3a
treea63d5e8d23de4fcf07c101df218ceda10145d196
parent3188fcebbcbd00c8bbabb5a622574717b6a4a517
nvme: release namespace SRCU protection before performing controller ioctls

[ Upstream commit 5fb4aac756acacf260b9ebd88747251effa3a2f2 ]

Holding the SRCU critical section protecting the namespace list can
cause deadlocks when using the per-namespace admin passthrough ioctl to
delete as namespace.  Release it earlier when performing per-controller
ioctls to avoid that.

Reported-by: Kenneth Heitke <kenneth.heitke@intel.com>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/core.c