Commit e90810b3 authored by Sagi Grimberg's avatar Sagi Grimberg Committed by Yang Yingliang
Browse files

nvme: fix controller removal race with scan work

mainline inclusion
from mainline-v5.3-rc5
commit 0157ec8d
category: bugfix
bugzilla: NA
CVE: NA
Link: https://gitee.com/openeuler/kernel/issues/I1WGZE



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

With multipath enabled, nvme_scan_work() can read from the device
(through nvme_mpath_add_disk()) and hang [1]. However, with fabrics,
once ctrl->state is set to NVME_CTRL_DELETING, the reads will hang
(see nvmf_check_ready()) and the mpath stack device make_request
will block if head->list is not empty. However, when the head->list
consistst of only DELETING/DEAD controllers, we should actually not
block, but rather fail immediately.

In addition, before we go ahead and remove the namespaces, make sure
to clear the current path and kick the requeue list so that the
request will fast fail upon requeuing.

[1]:
Acked-by: default avatarHanjun Guo <guohanjun@huawei.com>

Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent dbf7a19d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment