From 7d6c5283afe6fb5187d2e2a330376ad65f472537 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 5 Feb 2007 10:52:10 +0100 Subject: [PATCH] [PATCH] Fix sg ioengine We need to do the ->init() call after having opened the file, otherwise sg doesn't know what file type it is dealing with. Signed-off-by: Jens Axboe --- fio.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fio.c b/fio.c index 4c761c03..7ddde7d1 100644 --- a/fio.c +++ b/fio.c @@ -647,9 +647,6 @@ static void *thread_main(void *data) goto err; } - if (td_io_init(td)) - goto err; - if (init_iolog(td)) goto err; @@ -680,6 +677,13 @@ static void *thread_main(void *data) if (open_files(td)) goto err; + /* + * Do this late, as some IO engines would like to have the + * files setup prior to initializing structures. + */ + if (td_io_init(td)) + goto err; + if (td->exec_prerun) system(td->exec_prerun); -- 2.25.1