Skip to contentSkip to conversation

src/append_reader.c: print more info when it reads bad data

PATCH New Jeff Layton 1 participant 1 message Nov 5, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 src/append_reader.c: print more info when it reads bad data

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.

---
 src/append_reader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/append_reader.c +1 -1
index 6b9e4f68e572..4660268f2f52 100644
@@ -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);
 		}
 	}
Signature · 1 line
2.28.0