]> git.baikalelectronics.ru Git - kernel.git/commit
nvme: fix possible deadlock when nvme_update_formats fails
authorSagi Grimberg <sagi@grimberg.me>
Wed, 2 Oct 2019 17:52:25 +0000 (10:52 -0700)
committerSagi Grimberg <sagi@grimberg.me>
Sat, 5 Oct 2019 00:10:12 +0000 (17:10 -0700)
commit702a9442dcaec9baa54bb0887929cfc6dd8fe2a1
treed1329827ab7e23a19d126e6b8a28148ade259d66
parente43ce2e9f826ef4287949f6f224d505e659cf905
nvme: fix possible deadlock when nvme_update_formats fails

nvme_update_formats may fail to revalidate the namespace and
attempt to remove the namespace. This may lead to a deadlock
as nvme_ns_remove will attempt to acquire the subsystem lock
which is already acquired by the passthru command with effects.

Move the invalid namepsace removal to after the passthru command
releases the subsystem lock.

Reported-by: Judy Brock <judy.brock@samsung.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
drivers/nvme/host/core.c