Fix verify
[fio.git] / verify.c
index 662196678646d954cbb775246d9f582365c17ee5..0a504deb15f2e22ca6ce20a526296cd97102fcb4 100644 (file)
--- 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;
 
        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;
 
        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->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);
 
 
        data_len = header_len - hdr_size(hdr);