]> www.infradead.org Git - users/jedix/linux-maple.git/commit
nvme: Remove RCU namespace protection
authorAshok Vairavan <ashok.vairavan@oracle.com>
Mon, 10 Oct 2016 20:31:35 +0000 (13:31 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Sun, 16 Oct 2016 03:39:21 +0000 (20:39 -0700)
commit7be6ad4bef649be66ffdf1f9ab7771674924950f
tree1ea4c8e706bbbdb1daf48120ed794a63a180133e
parent47c24fed2b4b0c5d62936cbd337930424be0710f
nvme: Remove RCU namespace protection

We can't sleep with RCU read lock held, but we need to do potentially
blocking stuff to namespace queues when iterating the list. This patch
removes the RCU locking and holds a mutex instead.

To prevent deadlocks, this patch removes holding the mutex during
namespace scanning and removal. The unlocked namespace scanning is made
safe by holding a reference to the namespace being scanned.

List iteration that does IO has to be unlocked to allow error recovery.
The caller must ensure the list can not be manipulated during such an
event, so this patch adds a comment explaining this requirement to the
only function that iterates an unlocked list. All callers currently
meet this requirement, so no further changes required.

List iterations that do not do IO can safely use the lock since it couldn't
block recovery from missing forced IO completions.

Reported-by: Ming Lin <mlin at kernel.org>
[fixes 0bf77e9 nvme: switch to RCU freeing the namespace]
Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 32f0c4afb4363e31dad49202f1554ba591d649f2)

Orabug: 24583236
Signed-off-by: Ashok Vairavan <ashok.vairavan@oracle.com>
drivers/nvme/host/pci.c