From: Jeff Layton <jlayton@kernel.org>
To: Avi Weiss <thnkslprpt@gmail.com>,
Trond Myklebust <trondmy@kernel.org>,
Chuck Lever <cel@kernel.org>
Cc: Anna Schumaker <anna@kernel.org>, NeilBrown <neil@brown.name>,
linux-nfs@vger.kernel.org
Subject: Re: [PATCH] SUNRPC: wake poll waiters when an empty pipe is unlinked
Date: Tue, 20 Oct 2026 06:52:52 -0400 [thread overview]
Message-ID: <bc860288758cc86b86260cedb2ea5084f1b790a9.camel@kernel.org> (raw)
In-Reply-To: <20261020071455.775967-1-thnkslprpt@gmail.com>
On Tue, 2026-10-20 at 10:14 +0300, Avi Weiss wrote:
> When an empty rpc_pipefs pipe is unlinked, rpc_purge_list() returns
> without waking the pipe wait queue. An existing epoll waiter can
> remain blocked even though rpc_pipe_poll() reports EPOLLHUP and
> EPOLLERR for the disconnected pipe.
>
> Wake the wait queue after clearing RPC_I(inode)->pipe so existing
> poll waiters are notified regardless of whether messages were purged.
>
> Fixes: 9842ef3557ab ("SUNRPC: rpc_timeout_upcall_queue should not sleep")
> Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
> ---
>
> Tested with an empty rpc_pipefs pipe in QEMU:
> - 7.3.0 baseline: fresh poll() reports HUP/ERR (0x18),
> but an existing epoll_wait() times out.
> - 7.3.0 with this patch: fresh poll() reports HUP/ERR (0x18),
> and epoll_wait() returns events=0x18.
>
> net/sunrpc/rpc_pipe.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
> index 9d349cfbc4831..68b4e040a77d9 100644
> --- a/net/sunrpc/rpc_pipe.c
> +++ b/net/sunrpc/rpc_pipe.c
> @@ -191,6 +191,7 @@ rpc_close_pipes(struct dentry *dentry)
> cancel_delayed_work_sync(&pipe->queue_timeout);
> rpc_inode_setowner(inode, NULL);
> RPC_I(inode)->pipe = NULL;
> + wake_up(&RPC_I(inode)->waitq);
> inode_unlock(inode);
> }
>
>
> base-commit: c03c1a14507dfaf8b856c2608f9ac216021fc222
Reviewed-by: Jeff Layton <jlayton@kernel.org>
prev parent reply other threads:[~2026-10-20 10:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-20 7:14 [PATCH] SUNRPC: wake poll waiters when an empty pipe is unlinked Avi Weiss
2026-10-20 8:52 ` NeilBrown
2026-10-20 10:52 ` Jeff Layton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bc860288758cc86b86260cedb2ea5084f1b790a9.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=anna@kernel.org \
--cc=cel@kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neil@brown.name \
--cc=thnkslprpt@gmail.com \
--cc=trondmy@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox