[PATCH] fio: Assume verify is ok for a hole
authorJens Axboe <axboe@suse.de>
Fri, 4 Nov 2005 09:41:36 +0000 (10:41 +0100)
committerJens Axboe <axboe@suse.de>
Fri, 4 Nov 2005 09:41:36 +0000 (10:41 +0100)
fio.c

diff --git a/fio.c b/fio.c
index 9d886f2f1dfce5c42e75fef434e570744d518d19..c147ea758d7fd2f729c388d2550be4f1452fb43f 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -602,8 +602,16 @@ static int verify_io_u(struct thread_data *td, struct io_u *io_u)
        unsigned char *p = (unsigned char *) io_u->buf;
        struct md5_ctx md5_ctx;
 
-       if (hdr->fio_magic != FIO_HDR_MAGIC)
+       /*
+        * assume this is a file hole, if we have been doing random writes
+        * and magic is zero
+        */
+       if (hdr->fio_magic != FIO_HDR_MAGIC) {
+               if (!td->sequential && !hdr->fio_magic)
+                       return 0;
+
                return 1;
+       }
 
        memset(&md5_ctx, 0, sizeof(md5_ctx));
        p += sizeof(*hdr);