From: Jeff Layton <jlayton@kernel.org>
To: Olga Kornievskaia <aglo@umich.edu>, Chuck Lever <chuck.lever@oracle.com>
Cc: Olga Kornievskaia <okorniev@redhat.com>,
linux-nfs@vger.kernel.org, neil@brown.name, Dai.Ngo@oracle.com,
tom@talpey.com
Subject: Re: [PATCH 1/1] nfsd: unregister with rpcbind when removing listener
Date: Tue, 12 Aug 2025 15:57:00 -0400 [thread overview]
Message-ID: <07bb55026499e120c2057429beece2638f4e9256.camel@kernel.org> (raw)
In-Reply-To: <CAN-5tyEpg=vZGXkGYqjq3RLC_h=rt3akXGvnqKzddtLJ8Q0O4A@mail.gmail.com>
On Tue, 2025-08-12 at 15:13 -0400, Olga Kornievskaia wrote:
> On Tue, Aug 12, 2025 at 3:08 PM Chuck Lever <chuck.lever@oracle.com> wrote:
> >
> > On 8/12/25 3:02 PM, Olga Kornievskaia wrote:
> > > When a listener is added, a part of creation of transport also registers
> > > program/port with rpcbind. However, when the listener is removed,
> > > while transport goes away, rpcbind still has the entry for that
> > > port/type.
> > >
> > > Removal of listeners works by first removing all transports and then
> > > re-adding the ones that were not removed. In addition to destroying
> > > all transports, now also call the function that unregisters everything
> > > with the rpcbind. But we also then need to call the rpcbind setup
> > > function before adding back new transports.
> >
> > Removing all rpcbind registrations and then re-adding them might
> > cause an outage for clients that attempt to mount the server right
> > at that moment.
>
> Ok I'll take a look at unregistering elsewhere. But to note, removing
> a listener is only allowed when no threads are running. Thus no mounts
> are possible.
>
Right, which is why I think this is fine. There is a small chance a
client might see the bogus rpcbind registration, but that's still
better than the status quo.
> > > Fixes: d093c9089260 ("nfsd: fix management of listener transports")
> > > Signed-off-by: Olga Kornievskaia <okorniev@redhat.com>
> > > ---
> > > fs/nfsd/nfsctl.c | 5 ++++-
> > > 1 file changed, 4 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
> > > index 2909d70de559..99d06343117b 100644
> > > --- a/fs/nfsd/nfsctl.c
> > > +++ b/fs/nfsd/nfsctl.c
> > > @@ -1998,8 +1998,11 @@ int nfsd_nl_listener_set_doit(struct sk_buff *skb, struct genl_info *info)
> > > * Since we can't delete an arbitrary llist entry, destroy the
> > > * remaining listeners and recreate the list.
> > > */
> > > - if (delete)
> > > + if (delete) {
> > > svc_xprt_destroy_all(serv, net);
> > > + svc_rpcb_cleanup(serv, net);
> > > + svc_bind(serv, net);
> > > + }
> > >
> > > /* walk list of addrs again, open any that still don't exist */
> > > nlmsg_for_each_attr(attr, info->nlhdr, GENL_HDRLEN, rem) {
> >
> >
> > --
> > Chuck Lever
> >
Reviewed-by: Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2025-08-12 19:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-12 19:02 [PATCH 1/1] nfsd: unregister with rpcbind when removing listener Olga Kornievskaia
2025-08-12 19:08 ` Chuck Lever
2025-08-12 19:13 ` Olga Kornievskaia
2025-08-12 19:57 ` Jeff Layton [this message]
2025-08-12 20:00 ` Chuck Lever
2025-08-12 20:30 ` Jeff Layton
2025-08-14 13:46 ` Chuck Lever
2025-08-12 21:13 ` Tom Talpey
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=07bb55026499e120c2057429beece2638f4e9256.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=Dai.Ngo@oracle.com \
--cc=aglo@umich.edu \
--cc=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=neil@brown.name \
--cc=okorniev@redhat.com \
--cc=tom@talpey.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.