Commit ff0c17f8 authored by Anton Eidelman's avatar Anton Eidelman Committed by Yang Yingliang
Browse files

nvme: don't protect ns mutation with ns->head->lock

mainline inclusion
from mainline-v5.8-rc3
commit e164471d
category: bugfix
bugzilla: NA
CVE: NA
Link: https://gitee.com/openeuler/kernel/issues/I1WGZE



--------------------------------

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: 0d0b660f ("nvme: add ANA support")
Signed-off-by: default avatarAnton Eidelman <anton@lightbitslabs.com>
Signed-off-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Conflicts:
  drivers/nvme/host/multipath.c
[adjust context]
Reviewed-by: default avatarChao Leng <lengchao@huawei.com>
Reviewed-by: default avatarJike Cheng <chengjike.cheng@huawei.com>
Signed-off-by: default avatarLijie <lijie34@huawei.com>
Acked-by: default avatarHanjun Guo <guohanjun@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent adda4c9b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment