* [PATCH] pipe: pass a poll key when waking writers after a resize
@ 2026-09-16 15:57 Breno Leitao
2026-09-25 14:44 ` Christian Brauner
0 siblings, 1 reply; 2+ messages in thread
From: Breno Leitao @ 2026-09-16 15:57 UTC (permalink / raw)
To: Alexander Viro, Christian Brauner, Jan Kara
Cc: linux-fsdevel, linux-kernel, kernel-team, Breno Leitao, mjguzik, oleg
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 <leitao@debian.org>
---
This is the last NULL-key wakeup on a pipe wait queue that signals a data
or space event. The remaining ones in fs/pipe.c are all hangup broadcasts
(pipe_release(), wake_up_partner(), the fifo_open() error paths), where a
key would make no difference: poll, select and epoll all add
EPOLLERR | EPOLLHUP to the registered mask unconditionally, so those
wakeups can never be filtered out.
To: Alexander Viro <viro@zeniv.linux.org.uk>
To: Christian Brauner <brauner@kernel.org>
To: Jan Kara <jack@suse.cz>
Cc: linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: mjguzik@gmail.com
To: oleg@redhat.com
---
fs/pipe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/pipe.c b/fs/pipe.c
index 292425a834dd5..5791db016e242 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;
}
---
base-commit: 587858367581b9c55c3690f4e63382ad622719d4
change-id: 20260916-pipe-resize-poll-key-017a2180d481
Best regards,
--
Breno Leitao <leitao@debian.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] pipe: pass a poll key when waking writers after a resize
2026-09-16 15:57 [PATCH] pipe: pass a poll key when waking writers after a resize Breno Leitao
@ 2026-09-25 14:44 ` Christian Brauner
0 siblings, 0 replies; 2+ messages in thread
From: Christian Brauner @ 2026-09-25 14:44 UTC (permalink / raw)
To: Alexander Viro, Jan Kara, Breno Leitao
Cc: linux-fsdevel, linux-kernel, kernel-team, mjguzik, oleg
On Wed, 16 Sep 2026 08:57:14 -0700, Breno Leitao wrote:
> pipe: pass a poll key when waking writers after a resize
Applied to the vfs-7.4.misc branch of the vfs/vfs.git tree.
Patches in the vfs-7.4.misc branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-7.4.misc
[1/1] pipe: pass a poll key when waking writers after a resize
https://git.kernel.org/vfs/vfs/c/b76721a82cbe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-25 14:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-16 15:57 [PATCH] pipe: pass a poll key when waking writers after a resize Breno Leitao
2026-09-25 14:44 ` Christian Brauner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®