Skip to content

Commit

Permalink
io_uring: Remove unneeded test in io_run_task_work_sig()
Browse files Browse the repository at this point in the history
Avoid testing TIF_NOTIFY_SIGNAL twice by calling task_sigpending()
directly from io_run_task_work_sig()

Signed-off-by: Olivier Langlois <olivier@trillion01.com>
Link: https://lore.kernel.org/r/bd7c0495f7656e803e5736708591bb665e6eaacd.1645041650.git.olivier@trillion01.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Olivier Langlois authored and Jens Axboe committed Mar 10, 2022
1 parent 502c87d commit c5020bc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -7704,11 +7704,11 @@ static int io_run_task_work_sig(void)
{
if (io_run_task_work())
return 1;
if (!signal_pending(current))
return 0;
if (test_thread_flag(TIF_NOTIFY_SIGNAL))
return -ERESTARTSYS;
return -EINTR;
if (task_sigpending(current))
return -EINTR;
return 0;
}

/* when returns >0, the caller should retry */
Expand Down

0 comments on commit c5020bc

Please sign in to comment.