From e5c40aabb82b796e34f2ea7a184a3f72f5fb41e5 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Sat, 10 Feb 2007 12:57:55 +0100 Subject: [PATCH] [PATCH] Fix libaio engine SYNC io_prep_fsync() isn't supported at all in Linux currently, so fall back to fsync() if we get an -EINVAL return value. Signed-off-by: Jens Axboe --- engines/libaio.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/engines/libaio.c b/engines/libaio.c index 9a644f6f..c9560054 100644 --- a/engines/libaio.c +++ b/engines/libaio.c @@ -82,7 +82,17 @@ static int fio_libaio_queue(struct thread_data *td, struct io_u *io_u) usleep(100); else if (ret == -EINTR) continue; - else + else if (ret == -EINVAL && io_u->ddir == DDIR_SYNC) { + /* + * the async fsync doesn't currently seem to be + * supported, so just fsync if we fail with EINVAL + * for a sync. since buffered io is also sync + * with libaio (still), we don't have pending + * requests to flush first. + */ + ret = fsync(io_u->file->fd); + break; + } else break; } while (1); -- 2.25.1