From: Jens Axboe Date: Tue, 7 Feb 2006 13:23:54 +0000 (+0100) Subject: [PATCH] blkrawverify: account bad traces, don't dump a warning for each of them X-Git-Tag: blktrace-0.99.1~68 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=4ba99bfccc5ced4b57254d8df8edd616a6a923c0;p=blktrace.git [PATCH] blkrawverify: account bad traces, don't dump a warning for each of them --- 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;