module/ftl: Translate rc to spdk_bdev_io_status on submission error
Currently this translation was only done for IOs that were successfully submitted. This needs to be done on submission too, in order to pass the proper error code to the bdev layer. Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com> Change-Id: I69bf7b33b4d3a89199e1105c7f49ceeb7ab07da4 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15486 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
304f0802d1
commit
5f8c056649
@ -94,6 +94,7 @@ bdev_ftl_cb(void *arg, int rc)
|
||||
case 0:
|
||||
status = SPDK_BDEV_IO_STATUS_SUCCESS;
|
||||
break;
|
||||
case -EAGAIN:
|
||||
case -ENOMEM:
|
||||
status = SPDK_BDEV_IO_STATUS_NOMEM;
|
||||
break;
|
||||
@ -126,7 +127,7 @@ bdev_ftl_get_buf_cb(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io,
|
||||
bdev_io->u.bdev.iovs, bdev_io->u.bdev.iovcnt, bdev_ftl_cb, bdev_io);
|
||||
|
||||
if (spdk_unlikely(rc != 0)) {
|
||||
spdk_bdev_io_complete(bdev_io, rc);
|
||||
bdev_ftl_cb(bdev_io, rc);
|
||||
}
|
||||
}
|
||||
|
||||
@ -165,7 +166,7 @@ bdev_ftl_submit_request(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io
|
||||
int rc = _bdev_ftl_submit_request(ch, bdev_io);
|
||||
|
||||
if (spdk_unlikely(rc != 0)) {
|
||||
spdk_bdev_io_complete(bdev_io, rc);
|
||||
bdev_ftl_cb(bdev_io, rc);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user