thread: set non-zero status when spdk_for_each_channel fails
If spdk_for_each_channel is called on a device that doesn't exist, we need to set a non-zero status (-ENODEV in this case) to the completion function. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I898ad5ea499fb6087338b621b2befcadd6a05414 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13889 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Reviewed-by: Dong Yi <dongx.yi@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
6abaf4fc64
commit
821e673c1d
@ -2381,6 +2381,7 @@ spdk_for_each_channel(void *io_device, spdk_channel_msg fn, void *ctx,
|
|||||||
if (i->dev == NULL) {
|
if (i->dev == NULL) {
|
||||||
SPDK_ERRLOG("could not find io_device %p\n", io_device);
|
SPDK_ERRLOG("could not find io_device %p\n", io_device);
|
||||||
assert(false);
|
assert(false);
|
||||||
|
i->status = -ENODEV;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user