On 7/1/21 6:26 AM, Pavel Begunkov wrote: > If one entered io_req_task_work_add() not seeing PF_EXITING, it will set > a ->task_state bit and try task_work_add(), which may fail by that > moment. If that happens the function would try to cancel the request. > > However, in a meanwhile there might come other io_req_task_work_add() > callers, which will see the bit set and leave their requests in the > list, which will never be executed. > > Don't propagate an error, but clear the bit first and then fallback > all requests that we can splice from the list. The callback functions > have to be able to deal with PF_EXITING, so poll and apoll was modified > via changing io_poll_rewait(). I applied this one, adding a fixes tag too. Thanks! -- Jens Axboe