Fix O_DIRECT memory alignment
authorJens Axboe <jens.axboe@oracle.com>
Fri, 3 Jul 2009 06:30:15 +0000 (08:30 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 3 Jul 2009 06:30:15 +0000 (08:30 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fio.c

diff --git a/fio.c b/fio.c
index 47f3985980cb5427ede4a336eeb3b9686ef7f603..aabfee6544c2cda3c7228927500e77548d7440a6 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -799,7 +799,7 @@ static int init_io_u(struct thread_data *td)
        if (allocate_io_mem(td))
                return 1;
 
        if (allocate_io_mem(td))
                return 1;
 
-       if (td->o.mem_align)
+       if (td->o.odirect || td->o.mem_align)
                p = PAGE_ALIGN(td->orig_buffer) + td->o.mem_align;
        else
                p = td->orig_buffer;
                p = PAGE_ALIGN(td->orig_buffer) + td->o.mem_align;
        else
                p = td->orig_buffer;