src/append_reader.c: print more info when it reads bad data
authorJeff Layton <jlayton@kernel.org>
Thu, 5 Nov 2020 15:05:43 +0000 (10:05 -0500)
committerEryu Guan <guaneryu@gmail.com>
Sun, 8 Nov 2020 05:52:42 +0000 (13:52 +0800)
When append_reader gets bad data, print the actual and expected values.
This was helpful to me when hunting a failure in generic/069 on ceph
recently.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
src/append_reader.c

index 6b9e4f6..4660268 100644 (file)
@@ -34,7 +34,7 @@ int main(int argc, char **argv)
                }
 
                if (d != i) {
-                       fprintf(stderr, "bad data, offset = %u", i * 4);
+                       fprintf(stderr, "bad data, offset = %u, got %d wanted %d\n", i * 4, d, i);
                        exit(1);
                }
        }