From d300ec278f0c8ff8b60ed62d1701f0b3c92294b3 Mon Sep 17 00:00:00 2001 From: Naohiro Aota Date: Fri, 28 Feb 2020 16:12:46 +0900 Subject: [PATCH] backend: always clean up pending aios cleanup_pending_aios() is called when a thread exits with error, so all the call site of this function is under "if (td->error)". However, commit d28174f0189c ("workqueue: ensure we see deferred error for IOs"), for some reason, added "if (td->error) return" at the head of this function, making this function practically void. Revert this part to ensure cleaning up pending aios. Besides, cleanup_pending_aios() should not return even when io_u_queued_complete() failed. Because, it keeps in-flight aios left. Reviewed-by: Damien Le Moal Tested-by: Damien Le Moal Signed-off-by: Naohiro Aota Signed-off-by: Jens Axboe --- backend.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/backend.c b/backend.c index 936203dc..feb34e51 100644 --- a/backend.c +++ b/backend.c @@ -237,15 +237,10 @@ static void cleanup_pending_aio(struct thread_data *td) { int r; - if (td->error) - return; - /* * get immediately available events, if any */ r = io_u_queued_complete(td, 0); - if (r < 0) - return; /* * now cancel remaining active events -- 2.25.1