io_uring: don't gate task_work run on TIF_NOTIFY_SIGNAL
This isn't a reliable mechanism to tell if we have task_work pending, we really should be looking at whether we have any items queued. This is problematic if forward progress is gated on running said task_work. One such example is reading from a pipe, where the write side has been closed right before the read is started. The fput() of the file queues TWA_RESUME task_work, and we need that task_work to be run before ->release() is called for the pipe. If ->release() isn't called, then the read will sit forever waiting on data that will never arise. Fix this by io_run_task_work() so it checks if we have task_work pending rather than rely on TIF_NOTIFY_SIGNAL for that. The latter obviously doesn't work for task_work that is queued without TWA_SIGNAL. Reported-by:Christiano Haesbaert <haesbaert@haesbaert.org> Cc: stable@vger.kernel.org Link: https://github.com/axboe/liburing/issues/665 Signed-off-by:
Jens Axboe <axboe@kernel.dk>
Loading
-
mentioned in commit 61672e4c
-
mentioned in commit 0dd3bbd2
-
mentioned in commit 116bbbbf
-
mentioned in commit 9b1a3e42
-
mentioned in commit fc8a8820
-
mentioned in commit 8bfda6ec
-
mentioned in commit 66b53f31
-
mentioned in commit dcc5f95e
-
mentioned in commit 5ac869e3
-
mentioned in commit 786944d7
-
mentioned in commit ef0c71d0
-
mentioned in commit 7d5a22f0
-
mentioned in commit 81e56b99
-
mentioned in commit a2ddfc1c
-
mentioned in commit b1028025
-
mentioned in commit 898b94fd
-
mentioned in commit 7da44a4e
-
mentioned in commit eac8b6d3
-
mentioned in commit b99eb115
-
mentioned in commit dc99d6ad
-
mentioned in commit 5e6a7c06
-
mentioned in commit 5ebc0c1e
-
mentioned in commit c5ddd17e
-
mentioned in commit 2373a0c7
Please sign in to comment