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>
1 file changed