[PATCH] backend: fix data direction flow check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch fix regression caused SIGSEGV in case of writeonly 
or readonly mode.

Signed-off-by: Dmitry Monakhov <dmonakhov@xxxxxxxxxx>
---
 backend.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/backend.c b/backend.c
index 88623be..c31d22a 100644
--- 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) {
-- 
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux