From b76721a82cbe36ed3c28850566ac9041e71fda28 Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Wed, 16 Sep 2026 08:57:14 -0700 Subject: [PATCH] pipe: pass a poll key when waking writers after a resize pipe_resize_ring() wakes pipe->wr_wait with a NULL key. ep_poll_callback() and pollwake() only filter on the registered event mask when a key is supplied, so every epoll, poll() and select() waiter on the write queue is woken, whether or not it asked for the event that occurred. The event is the one the comment above the wakeup already names: more room for writers. anon_pipe_write() passes EPOLLOUT | EPOLLWRNORM when waking the same queue; do the same here. Writers blocked in wait_event_interruptible_exclusive() are unaffected, as autoremove_wake_function() ignores the key. Signed-off-by: Breno Leitao Link: https://patch.msgid.link/20260916-pipe-resize-poll-key-v1-1-0f8f04f7dd5e@debian.org Signed-off-by: Christian Brauner (Amutable) --- fs/pipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/pipe.c b/fs/pipe.c index 292425a834dd..5791db016e24 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -1433,7 +1433,7 @@ int pipe_resize_ring(struct pipe_inode_info *pipe, unsigned int nr_slots) spin_unlock_irq(&pipe->rd_wait.lock); /* This might have made more room for writers */ - wake_up_interruptible(&pipe->wr_wait); + wake_up_interruptible_poll(&pipe->wr_wait, EPOLLOUT | EPOLLWRNORM); return 0; }