From: Naohiro Aota Date: Fri, 28 Feb 2020 07:12:47 +0000 (+0900) Subject: io_u: ensure io_u_quiesce() to process all the IOs X-Git-Tag: fio-3.20~52 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=2dcfdeb964c1b009e018443a5f0b3b95b282ad90 io_u: ensure io_u_quiesce() to process all the IOs Currently, when IO have an error io_u_quiesce() stops processing in-flight IOs there and leaves other IOs non-completed. This is not a desired behavior for io_u_quiesce(). Fix it by continuing even on error. Reviewed-by: Damien Le Moal Tested-by: Damien Le Moal Signed-off-by: Naohiro Aota Signed-off-by: Jens Axboe --- diff --git a/io_u.c b/io_u.c index bcb893c5..5d62a76c 100644 --- a/io_u.c +++ b/io_u.c @@ -606,7 +606,7 @@ static inline enum fio_ddir get_rand_ddir(struct thread_data *td) int io_u_quiesce(struct thread_data *td) { - int ret = 0, completed = 0; + int ret = 0, completed = 0, err = 0; /* * We are going to sleep, ensure that we flush anything pending as @@ -625,7 +625,7 @@ int io_u_quiesce(struct thread_data *td) if (ret > 0) completed += ret; else if (ret < 0) - break; + err = ret; } if (td->flags & TD_F_REGROW_LOGS) @@ -634,7 +634,7 @@ int io_u_quiesce(struct thread_data *td) if (completed) return completed; - return ret; + return err; } static enum fio_ddir rate_ddir(struct thread_data *td, enum fio_ddir ddir)