From 76a00ec6684317902e536365b89531431e7f8867 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 28 Apr 2015 15:30:02 -0600 Subject: [PATCH 1/1] blktrace: only set O_DIRECT if the min bs is a multiple of 4k Signed-off-by: Jens Axboe --- blktrace.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/blktrace.c b/blktrace.c index 8ffa9b0e..bb0bcbe6 100644 --- a/blktrace.c +++ b/blktrace.c @@ -503,9 +503,10 @@ int load_blktrace(struct thread_data *td, const char *filename, int need_swap) /* * We need to do direct/raw ios to the device, to avoid getting - * read-ahead in our way. + * read-ahead in our way. But only do so if the minimum block size + * is a multiple of 4k, otherwise we don't know if it's safe to do so. */ - if (!fio_option_is_set(&td->o, odirect)) + if (!fio_option_is_set(&td->o, odirect) && !(td_min_bs(td) & 4095)) td->o.odirect = 1; /* -- 2.25.1