• Anton Eidelman's avatar
    nvme-multipath: fix possible I/O hang when paths are updated · e1031b6c
    Anton Eidelman authored
    [ Upstream commit 504db087 ]
    
    nvme_state_set_live() making a path available triggers requeue_work
    in order to resubmit requests that ended up on requeue_list when no
    paths were available.
    
    This requeue_work may race with concurrent nvme_ns_head_make_request()
    that do not observe the live path yet.
    Such concurrent requests may by made by either:
    - New IO submission.
    - Requeue_work triggered by nvme_failover_req() or another ana_work.
    
    A race may cause requeue_work capture the state of requeue_list before
    more requests get onto the list. These requests will stay on the list
    forever unless requeue_work is triggered again.
    
    In order to prevent such race, nvme_state_set_live() should
    synchronize_srcu(&head->srcu) before triggering the requeue_work and
    prevent nvme_ns_head_make_request referencing an old snapshot of the
    path list.
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarAnton Eidelman <anton@lightbitslabs.com>
    Signed-off-by: Sagi Grimberg's avatarSagi Grimberg <sagi@grimberg.me>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
    e1031b6c
Name
Last commit
Last update
Documentation Loading commit data...
LICENSES Loading commit data...
arch Loading commit data...
block Loading commit data...
certs Loading commit data...
crypto Loading commit data...
drivers Loading commit data...
fs Loading commit data...
include Loading commit data...
init Loading commit data...
ipc Loading commit data...
kernel Loading commit data...
lib Loading commit data...
mm Loading commit data...
net Loading commit data...
samples Loading commit data...
scripts Loading commit data...
security Loading commit data...
sound Loading commit data...
tools Loading commit data...
usr Loading commit data...
virt Loading commit data...
.clang-format Loading commit data...
.cocciconfig Loading commit data...
.get_maintainer.ignore Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
Kbuild Loading commit data...
Kconfig Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README Loading commit data...