Fix race condition when using asynch verify

I discovered the race condition when using asynch verify with libaio engine.
The code assumes that because the td->cur_depth value is not 0 that
there is still I/O pending and issues io_getevents when the I/O was
actually being verified by the asynchronous verify thread. This causes
the code to hang.

(Updated by Jens to use a new io_u->flag bitfield instead of adding a new
 integer to struct io_u).

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
3 files changed