summaryrefslogtreecommitdiff
path: root/blkrawverify.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2006-02-07 14:23:54 +0100
committerJens Axboe <axboe@suse.de>2006-02-07 14:23:54 +0100
commit4ba99bfccc5ced4b57254d8df8edd616a6a923c0 (patch)
tree29fa50dfc04842ae4f133d9095851eda3ea03f4d /blkrawverify.c
parent86368eb510bcc9b918eb870c90d5eb4271083267 (diff)
downloadblktrace-4ba99bfccc5ced4b57254d8df8edd616a6a923c0.tar.gz
blktrace-4ba99bfccc5ced4b57254d8df8edd616a6a923c0.tar.bz2
[PATCH] blkrawverify: account bad traces, don't dump a warning for each of them
Diffstat (limited to 'blkrawverify.c')
-rw-r--r--blkrawverify.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/blkrawverify.c b/blkrawverify.c
index 51e7963..7c64aa8 100644
--- a/blkrawverify.c
+++ b/blkrawverify.c
@@ -151,11 +151,17 @@ static int process(FILE *ofp, char *file, unsigned int cpu)
ifp = fopen(file, "r");
while ((n = fread(bit, sizeof(struct blk_io_trace), 1, ifp)) == 1) {
trace_to_cpu(bit);
- if (verify_trace(bit)) {
+
+ if (!CHECK_MAGIC(bit)) {
INC_BAD("bad trace");
continue;
}
+ if ((bit->magic & 0xff) != SUPPORTED_VERSION) {
+ fprintf(stderr, "unsupported trace version\n");
+ break;
+ }
+
if (bit->pdu_len) {
char *pdu_buf;