X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=engines%2Fsg.c;h=57c3834add235362acdd18ee672c176456ae9e16;hb=e943b8785fa19ab5536d91242f1063ae809cdf2b;hp=39f99d8d0922050eb1a3aa3d60305cd865a09113;hpb=9d7dfdaef1ed5f6227fd31117d310ac15ae63152;p=fio.git diff --git a/engines/sg.c b/engines/sg.c index 39f99d8d..57c3834a 100644 --- a/engines/sg.c +++ b/engines/sg.c @@ -240,11 +240,14 @@ static int fio_sgio_prep(struct thread_data *td, struct io_u *io_u) static int fio_sgio_queue(struct thread_data *td, struct io_u *io_u) { struct sg_io_hdr *hdr = &io_u->hdr; - int ret; + int ret, do_sync = 0; fio_ro_check(td, io_u); - ret = fio_sgio_doio(td, io_u, io_u->ddir == DDIR_SYNC); + if (td->o.sync_io || td->o.odirect || ddir_sync(io_u->ddir)) + do_sync = 1; + + ret = fio_sgio_doio(td, io_u, do_sync); if (ret < 0) io_u->error = errno;