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 <axboe@kernel.dk>
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;