+18
−12
Loading
With the previous code, it was possible to sporadically hit:
spdk_for_each_channel: *ERROR*: could not find io_device
This happened because nvme_ctrlr might not be registered as an
io_device but provided as an argument to spdk_for_each_channel.
See the negative path handling of the admin qpair, e.g.:
bdev_nvme_poll_adminq ->
bdev_nvme_failover_ctrlr ->
_bdev_nvme_reset_ctrlr ->
bdev_nvme_reset_destroy_qpairs ->
nvme_ctrlr_for_each_channel
or
bdev_nvme_poll_adminq ->
bdev_nvme_clear_io_path_caches ->
nvme_ctrlr_for_each_channel
Or JSON-RPC methods:
bdev_nvme_remove_error_injection ->
nvme_ctrlr_for_each_channel
or
bdev_nvme_add_error_injection ->
nvme_ctrlr_for_each_channel
With early registration, these flows simply iterate through 0 channels
and return success.
bdev_nvme_poll_adminq registration cannot be delayed because of
outstanding log page command.
Introduction of an additional flag (registered) and conditional
logic within nvme_ctrlr_for_each_channel should also work.
Fixes #3736
Change-Id: Icbc4fdbcf3a1505d34dd8ddb566992a74ba7c03e
Signed-off-by:
Jacek Kalwas <jacek.kalwas@nutanix.com>
Reviewed-on: https://review.spdk.io/c/spdk/spdk/+/26926
Tested-by:
SPDK Automated Test System <spdkbot@gmail.com>
Reviewed-by:
Tomasz Zawadzki <tomasz@tzawadzki.com>
Reviewed-by:
Shuhei Matsumoto <smatsumoto@nvidia.com>
Community-CI: Mellanox Build Bot
Reviewed-by:
Pierre Lestringant <plestringant@kalrayinc.com>