diff options
author | Jens Axboe <axboe@kernel.dk> | 2022-09-29 15:29:13 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-10-29 10:08:35 +0200 |
commit | 5a7d9406321093b75393ae6524a9f929f5544c07 (patch) | |
tree | f4edc52cf882ab842eade25dff81178f34d33c16 /fs/ext4/fast_commit.c | |
parent | e4c2e8f738488d83ebb81a9788b5e3b7f9806ccf (diff) |
io_uring: don't gate task_work run on TIF_NOTIFY_SIGNAL
[ Upstream commit 46a525e199e4037516f7e498c18f065b09df32ac ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/ext4/fast_commit.c')
0 files changed, 0 insertions, 0 deletions