linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] aio: Fix incorrect usage of eventfd_signal_allowed()
@ 2021-09-13 11:19 Xie Yongji
  2021-09-14 12:46 ` Thomas Gleixner
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Xie Yongji @ 2021-09-13 11:19 UTC (permalink / raw)
  To: bcrl, viro, tglx, axboe; +Cc: linux-aio, linux-fsdevel, linux-kernel

We should defer eventfd_signal() to the workqueue when
eventfd_signal_allowed() return false rather than return
true.

Fixes: b542e383d8c0 ("eventfd: Make signal recursion protection a task bit")
Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
---
 fs/aio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/aio.c b/fs/aio.c
index 51b08ab01dff..8822e3ed4566 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1695,7 +1695,7 @@ static int aio_poll_wake(struct wait_queue_entry *wait, unsigned mode, int sync,
 		list_del(&iocb->ki_list);
 		iocb->ki_res.res = mangle_poll(mask);
 		req->done = true;
-		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);
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-12-12  8:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-13 11:19 [PATCH] aio: Fix incorrect usage of eventfd_signal_allowed() Xie Yongji
2021-09-14 12:46 ` Thomas Gleixner
2021-11-14  7:15 ` Yongji Xie
2021-12-07 11:38   ` Yongji Xie
2021-12-07 23:33 ` Eric Biggers
2021-12-10 18:53   ` Eric Biggers
2021-12-12  8:07     ` Yongji Xie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).