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. Signed-off-by: Naohiro Aota <naohiro.aota@xxxxxxx> --- backend.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/backend.c b/backend.c index 936203dcb1c4..feb34e51382f 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