From: Jens Axboe Date: Mon, 5 Feb 2007 09:52:10 +0000 (+0100) Subject: [PATCH] Fix sg ioengine X-Git-Tag: fio-1.12~140 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=7d6c5283afe6fb5187d2e2a330376ad65f472537;p=fio.git [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 --- 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);