]> git.baikalelectronics.ru Git - kernel.git/commit
nvme: fix possible hang when ns scanning fails during error recovery
authorSagi Grimberg <sagi@grimberg.me>
Wed, 6 May 2020 22:44:02 +0000 (15:44 -0700)
committerJens Axboe <axboe@kernel.dk>
Sat, 9 May 2020 22:07:58 +0000 (16:07 -0600)
commit408dc9fb080e8b01d7ab75468c4f85cd3958605f
tree09bf87e587816c177912f01355dc42ca9252de94
parentd65106e71498634e1648bff415a6f01e02deb9ef
nvme: fix possible hang when ns scanning fails during error recovery

When the controller is reconnecting, the host fails I/O and admin
commands as the host cannot reach the controller. ns scanning may
revalidate namespaces during that period and it is wrong to remove
namespaces due to these failures as we may hang (see 42930c14f26d).

One command that may fail is nvme_identify_ns_descs. Since we return
success due to having ns identify descriptor list optional, we continue
to compare ns identifiers in nvme_revalidate_disk, obviously fail and
return -ENODEV to nvme_validate_ns, which will remove the namespace.

Exactly what we don't want to happen.

Fixes: 20c608c9b372 ("nvme: Namepace identification descriptor list is optional")
Tested-by: Anton Eidelman <anton@lightbitslabs.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/host/core.c