]> git.baikalelectronics.ru Git - kernel.git/commit
nvme: don't protect ns mutation with ns->head->lock
authorSagi Grimberg <sagi@grimberg.me>
Wed, 24 Jun 2020 08:53:10 +0000 (01:53 -0700)
committerChristoph Hellwig <hch@lst.de>
Wed, 24 Jun 2020 16:41:20 +0000 (18:41 +0200)
commit393356ab1774a7ce4f9658fd38e29be73a881302
treebfe6e5c4db8d1c41dce30cb46cf66e8f768c2b23
parent1ef19f5daed5a6253c5a26216e66906f92f07f4d
nvme: don't protect ns mutation with ns->head->lock

Right now ns->head->lock is protecting namespace mutation
which is wrong and unneeded. Move it to only protect
against head mutations. While we're at it, remove unnecessary
ns->head reference as we already have head pointer.

The problem with this is that the head->lock spans
mpath disk node I/O that may block under some conditions (if
for example the controller is disconnecting or the path
became inaccessible), The locking scheme does not allow any
other path to enable itself, preventing blocked I/O to complete
and forward-progress from there.

This is a preparation patch for the fix in a subsequent patch
where the disk I/O will also be done outside the head->lock.

Fixes: 947f0d91a7f1 ("nvme: add ANA support")
Signed-off-by: Anton Eidelman <anton@lightbitslabs.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/multipath.c