summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2012-02-24 08:26:57 +0100
committerJens Axboe <axboe@kernel.dk>2012-02-24 08:26:57 +0100
commit096151143a9bac51ebf6f266dcc3a70c19b1deb6 (patch)
treed991d825c480a66a324722ab6e2f39a17e5e57ca
parentc2cb68696255a8fda93043a1f2219b60af614549 (diff)
downloadfio-096151143a9bac51ebf6f266dcc3a70c19b1deb6.tar.gz
fio-096151143a9bac51ebf6f266dcc3a70c19b1deb6.tar.bz2
Fix verify
The hole commit from yesterday (d3a173a9) had a bug, where we would checksum too much. Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--verify.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/verify.c b/verify.c
index 66219667..0a504deb 100644
--- a/verify.c
+++ b/verify.c
@@ -654,7 +654,7 @@ static int verify_header(struct verify_header *hdr)
if (hdr->magic != FIO_HDR_MAGIC)
return 0;
- crc = crc32c(p, sizeof(*hdr) - sizeof(hdr->crc32));
+ crc = crc32c(p, offsetof(struct verify_header, crc32));
if (crc == hdr->crc32)
return 1;
@@ -859,7 +859,7 @@ static void populate_hdr(struct thread_data *td, struct io_u *io_u,
hdr->verify_type = td->o.verify;
hdr->len = header_len;
hdr->rand_seed = io_u->rand_seed;
- hdr->crc32 = crc32c(p, sizeof(*hdr) - sizeof(hdr->crc32));
+ hdr->crc32 = crc32c(p, offsetof(struct verify_header, crc32));
data_len = header_len - hdr_size(hdr);