engines/sg: ensure we complete the right command for sync IO
authorJens Axboe <axboe@kernel.dk>
Thu, 28 Feb 2019 17:04:38 +0000 (10:04 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 28 Feb 2019 17:05:35 +0000 (10:05 -0700)
commita999bc49d7aadbd9b3ab07c2f43433fc90bbe582
tree3f84d64e2b0014a348d71857b718e9037423a37f
parent66a8a1bf98d714e013ee329dc975f3b6b552de6d
engines/sg: ensure we complete the right command for sync IO

Currently we just read back the first command that completes, and
assume it's the right one. That's totally bogus, we need to keep
going until we find the right completion.

Also only call td_verror() if we have an error, not uncondtionally.

Fixes: https://github.com/axboe/fio/issues/743
Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/sg.c