diff --git a/fs/io-wq.c b/fs/io-wq.c index 8c61315657546..e8f77903d7757 100644 --- a/fs/io-wq.c +++ b/fs/io-wq.c @@ -711,6 +711,13 @@ static bool io_wq_work_match_all(struct io_wq_work *work, void *data) static inline bool io_should_retry_thread(long err) { + /* + * Prevent perpetual task_work retry, if the task (or its group) is + * exiting. + */ + if (fatal_signal_pending(current)) + return false; + switch (err) { case -EAGAIN: case -ERESTARTSYS: