]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
fstest: fix dumping of miscompare buffer
authorChristoph Hellwig <hch@infradead.org>
Mon, 29 Sep 2014 03:11:33 +0000 (13:11 +1000)
committerDave Chinner <david@fromorbit.com>
Mon, 29 Sep 2014 03:11:33 +0000 (13:11 +1000)
When fstests finds a miscompare it tries to dump the corrupted
bytes from the buffer, but due to an incorrect comparism actully
dumps the correct part of it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Dave Chinner <david@fromorbit.com>
src/fstest.c

index 2e92fd8db9595a8e92ef5a784cd57d09879c0b7c..f7e2d3eb4adbea47450a5016673828bcac5623ea 100644 (file)
@@ -73,7 +73,7 @@ static void check_buffer(uchar *buf, int loop, int child, int fnum, int ofs)
                for (j=0;j<MIN(20, block_size-i);j++) {
                        printf("%02x ", buf[j+i]);
                }
-               for (j=i;buf[j] == buf2[j] && j<block_size;j++) ;
+               for (j=i;buf[j] != buf2[j] && j<block_size;j++) ;
                printf("Corruption length: %d\n", j - i);
                printf("\n");
                exit(1);