From: Naohiro Aota Date: Tue, 22 Aug 2023 07:28:50 +0000 (+0900) Subject: aio-dio-write-verify: check for the IO errors X-Git-Tag: v2023.09.03~18 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=2817df3ae9d70900eae9e3a7f399ab5ec5524728;p=xfstests-dev.git aio-dio-write-verify: check for the IO errors The async write IOs can return some errors, which may lead to a short read or corruption in io_verify() stage. Catch an error early to identify the root cause easily. Signed-off-by: Naohiro Aota Reviewed-by: Zorro Lang Signed-off-by: Zorro Lang --- diff --git a/src/aio-dio-regress/aio-dio-write-verify.c b/src/aio-dio-regress/aio-dio-write-verify.c index 302b8fe4..90e41b39 100644 --- a/src/aio-dio-regress/aio-dio-write-verify.c +++ b/src/aio-dio-regress/aio-dio-write-verify.c @@ -238,6 +238,16 @@ static int io_write(int fd, int num_events) return 1; } + for (i = 0; i < num_events; i++) { + int err = (int)evs[i].res; + + if (err < 0) { + fprintf(stderr, "error %s with event %d\n", + strerror(err), i); + return 1; + } + } + /* Try to destroy at here, not necessary, so don't check result */ io_destroy(ctx);