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>
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);