From 7508b3948a216106196cec33a3a707d6f32d84a8 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 28 Feb 2019 10:07:38 -0700 Subject: [PATCH] engines/sg: ensure we flag EIO on the right io_u For sync complete, set it on the io_u that corresponds to the hdr we just read. Fixes: a999bc49d7aa ("engines/sg: ensure we complete the right command for sync IO") Signed-off-by: Jens Axboe --- engines/sg.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engines/sg.c b/engines/sg.c index a5a4b138..c46b9aba 100644 --- a/engines/sg.c +++ b/engines/sg.c @@ -448,11 +448,12 @@ static enum fio_q_status fio_sgio_rw_doio(struct thread_data *td, if (ret < 0) return ret; + __io_u = hdr->usr_ptr; + /* record if an io error occurred */ if (hdr->info & SG_INFO_CHECK) - io_u->error = EIO; + __io_u->error = EIO; - __io_u = hdr->usr_ptr; if (__io_u == io_u) break; -- 2.25.1