bdev/aio: Correct error message when IO fails

structure io_event defined in aio_abi.h has
res member with type __s64 which is typically
mapped to long long int.
When we print error message, res member can be
treated as an error code.

In the following error message:
	failed to complete aio: requested len is 4096, but
	completed len is 18446744073709551611
the last digit in int representation is -5 which is -EIO

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reported-by: Anil <aniruddha080699@gmail.com>
Change-Id: I33b98d2118bbc9cace2d9da7cf9cd9bd06d784e6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11453
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
This commit is contained in:
Alexey Marchuk 2022-02-08 17:50:52 +03:00 committed by Tomasz Zawadzki
parent e5d35ad166
commit b5b752792f

View File

@ -3,6 +3,7 @@
*
* Copyright (c) Intel Corporation.
* All rights reserved.
* Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -358,8 +359,7 @@ bdev_aio_io_channel_poll(struct bdev_aio_io_channel *io_ch)
spdk_bdev_io_complete_aio_status(spdk_bdev_io_from_ctx(aio_task), -aio_errno);
} else {
SPDK_ERRLOG("failed to complete aio: requested len is %lu, but completed len is %lu.\n",
aio_task->len, io_result);
SPDK_ERRLOG("failed to complete aio: rc %"PRId64"\n", events[i].res);
spdk_bdev_io_complete(spdk_bdev_io_from_ctx(aio_task), SPDK_BDEV_IO_STATUS_FAILED);
}
}