Skip to content

Commit

Permalink
aio: Fix incorrect usage of eventfd_signal_allowed()
Browse files Browse the repository at this point in the history
We should defer eventfd_signal() to the workqueue when
eventfd_signal_allowed() return false rather than return
true.

Fixes: b542e38 ("eventfd: Make signal recursion protection a task bit")
Signed-off-by: Xie Yongji <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Eric Biggers <[email protected]>
Signed-off-by: Eric Biggers <[email protected]>
  • Loading branch information
YongjiXie authored and ebiggers committed Dec 9, 2021
1 parent 50252e4 commit 4b37498
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1760,7 +1760,7 @@ static int aio_poll_wake(struct wait_queue_entry *wait, unsigned mode, int sync,
list_del_init(&req->wait.entry);
list_del(&iocb->ki_list);
iocb->ki_res.res = mangle_poll(mask);
if (iocb->ki_eventfd && eventfd_signal_allowed()) {
if (iocb->ki_eventfd && !eventfd_signal_allowed()) {
iocb = NULL;
INIT_WORK(&req->work, aio_poll_put_work);
schedule_work(&req->work);
Expand Down

0 comments on commit 4b37498

Please sign in to comment.