From: Jens Axboe Date: Tue, 28 Apr 2015 21:30:02 +0000 (-0600) Subject: blktrace: only set O_DIRECT if the min bs is a multiple of 4k X-Git-Tag: fio-2.2.8~23 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=76a00ec6684317902e536365b89531431e7f8867 blktrace: only set O_DIRECT if the min bs is a multiple of 4k Signed-off-by: Jens Axboe --- 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; /*