Linux NFS development
 help / color / mirror / Atom feed
From: Avi Weiss <thnkslprpt@gmail.com>
To: Trond Myklebust <trondmy@kernel.org>, Chuck Lever <cel@kernel.org>
Cc: Anna Schumaker <anna@kernel.org>,
	Jeff Layton <jlayton@kernel.org>, NeilBrown <neil@brown.name>,
	linux-nfs@vger.kernel.org
Subject: [PATCH] SUNRPC: wake poll waiters when an empty pipe is unlinked
Date: Tue, 20 Oct 2026 10:14:55 +0300	[thread overview]
Message-ID: <20261020071455.775967-1-thnkslprpt@gmail.com> (raw)

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
-- 
2.43.0


             reply	other threads:[~2026-10-20  7:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-20  7:14 Avi Weiss [this message]
2026-10-20  8:52 ` [PATCH] SUNRPC: wake poll waiters when an empty pipe is unlinked NeilBrown
2026-10-20 10:52 ` Jeff Layton

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=20261020071455.775967-1-thnkslprpt@gmail.com \
    --to=thnkslprpt@gmail.com \
    --cc=anna@kernel.org \
    --cc=cel@kernel.org \
    --cc=jlayton@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neil@brown.name \
    --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