Fix short IO handling for verifies as well
authorJens Axboe <jens.axboe@oracle.com>
Wed, 28 Mar 2007 09:10:09 +0000 (11:10 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Wed, 28 Mar 2007 09:10:09 +0000 (11:10 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fio.c
io_u.c

diff --git a/fio.c b/fio.c
index ef63ce6..125cf6f 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -342,10 +342,17 @@ static void do_verify(struct thread_data *td)
                                        put_io_u(td, io_u);
                                        break;
                                }
+
                                io_u->xfer_buflen = io_u->resid;
                                io_u->xfer_buf += bytes;
+                               io_u->offset += bytes;
+
+                               if (io_u->offset == io_u->file->real_file_size)
+                                       goto sync_done;
+
                                requeue_io_u(td, &io_u);
                        } else {
+sync_done:
                                ret = io_u_sync_complete(td, io_u);
                                if (ret < 0)
                                        break;
diff --git a/io_u.c b/io_u.c
index b0f4355..17e188a 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -158,7 +158,6 @@ static int get_next_offset(struct thread_data *td, struct io_u *io_u)
 
 static unsigned int get_next_buflen(struct thread_data *td, struct io_u *io_u)
 {
-       struct fio_file *f = io_u->file;
        const int ddir = io_u->ddir;
        unsigned int buflen;
        long r;