From: Jens Axboe Date: Thu, 28 Feb 2019 17:07:38 +0000 (-0700) Subject: engines/sg: ensure we flag EIO on the right io_u X-Git-Tag: fio-3.14~26 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=7508b3948a216106196cec33a3a707d6f32d84a8;p=fio.git 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 --- 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;