diff --git a/fs/io_uring.c b/fs/io_uring.c index d0172cc4f6427b16f4784939fd691946b677eff7..691c9986914396102d901d76bb70b14745366acc 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -5083,6 +5083,9 @@ static void __io_queue_proc(struct io_poll_iocb *poll, struct io_poll_table *pt, pt->error = -EINVAL; return; } + /* double add on the same waitqueue head, ignore */ + if (poll->head == head) + return; poll = kmalloc(sizeof(*poll), GFP_ATOMIC); if (!poll) { pt->error = -ENOMEM;