]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
aio-dio-write-verify: print more info on the error case
authorNaohiro Aota <naohiro.aota@wdc.com>
Tue, 22 Aug 2023 07:28:51 +0000 (16:28 +0900)
committerZorro Lang <zlang@kernel.org>
Fri, 1 Sep 2023 19:27:32 +0000 (03:27 +0800)
When short read or corruption happened, it is difficult to locate which IO
event failed. Print the address to make it identifiable.

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
src/aio-dio-regress/aio-dio-write-verify.c

index 90e41b391289587a94efa0489f331d859fa09bf1..dabbfacde3f8adaa0c1e47267107cc3a4d2c0981 100644 (file)
@@ -267,13 +267,14 @@ static int io_verify(int fd)
                        perror("pread");
                        return 1;
                } else if (sret != p->param->buf_size) {
-                       fprintf(stderr, "short read %zd was less than %zu\n",
-                               sret, p->param->buf_size);
+                       fprintf(stderr, "short read %zd was less than %zu at %zu\n",
+                               sret, p->param->buf_size, p->param->offset);
                        return 1;
                }
                if (memcmp(p->param->buf,
                           p->param->cmp_buf, p->param->buf_size)) {
-                       printf("Find corruption\n");
+                       printf("Find corruption at %zu length %zu\n", p->param->offset,
+                              p->param->buf_size);
                        dump_buffer(p->param->buf, p->param->offset,
                                    p->param->buf_size);
                        corrupted++;