diff options
author | Naohiro Aota <naohiro.aota@wdc.com> | 2023-08-22 16:28:50 +0900 |
---|---|---|
committer | Zorro Lang <zlang@kernel.org> | 2023-09-02 03:27:32 +0800 |
commit | 2817df3ae9d70900eae9e3a7f399ab5ec5524728 (patch) | |
tree | 8fbd14060559a0b87b57136c4379aeb3d299ef78 | |
parent | fd94fc408b3ee0b3e9f05b9327a67736980af442 (diff) | |
download | xfstests-dev-2817df3ae9d70900eae9e3a7f399ab5ec5524728.tar.gz |
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 <naohiro.aota@wdc.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
-rw-r--r-- | src/aio-dio-regress/aio-dio-write-verify.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/aio-dio-regress/aio-dio-write-verify.c b/src/aio-dio-regress/aio-dio-write-verify.c index 302b8fe4a0..90e41b3912 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); |