From 2dcfdeb964c1b009e018443a5f0b3b95b282ad90 Mon Sep 17 00:00:00 2001 From: Naohiro Aota Date: Fri, 28 Feb 2020 16:12:47 +0900 Subject: [PATCH] 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 --- io_u.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) -- 2.25.1