Skip to contentSkip to conversation

fstest: fix dumping of miscompare buffer

PATCH In review Christoph Hellwig 2 participants 2 messages Sep 26, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fstest: fix dumping of miscompare buffer

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.

src/fstest.c +1 -1
index 2e92fd8..f7e2d3e 100644
@@ -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);