backend: fix data direction flow check
authorDmitry Monakhov <dmonakhov@openvz.org>
Tue, 25 Sep 2012 10:12:36 +0000 (12:12 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 25 Sep 2012 10:12:36 +0000 (12:12 +0200)
This patch fix regression caused SIGSEGV in case of writeonly
or readonly mode, caused by commit 59d8d0f5.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
backend.c

index 88623be..c31d22a 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -812,7 +812,7 @@ static int init_io_u(struct thread_data *td)
        td->orig_buffer_size = (unsigned long long) max_bs
                                        * (unsigned long long) max_units;
 
-       if ((td->io_ops->flags & FIO_NOIO) || !td_rw(td))
+       if ((td->io_ops->flags & FIO_NOIO) || !(td_read(td) || td_write(td)))
                data_xfer = 0;
 
        if (td->o.mem_type == MEM_SHMHUGE || td->o.mem_type == MEM_MMAPHUGE) {