From: Jeff Layton <jlayton@kernel.org>
To: Chuck Lever III <chuck.lever@oracle.com>,
Lorenzo Bianconi <lorenzo@kernel.org>, Neil Brown <neilb@suse.de>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
Lorenzo Bianconi <lorenzo.bianconi@redhat.com>,
Jakub Kicinski <kuba@kernel.org>, Simon Horman <horms@kernel.org>,
"open list:NETWORKING [GENERAL]" <netdev@vger.kernel.org>
Subject: Re: [PATCH v6 3/3] NFSD: add write_ports to netlink command
Date: Wed, 24 Jan 2024 13:10:53 -0500 [thread overview]
Message-ID: <55283b0a01d3b3ae2eb965929a6d81256a48b11e.camel@kernel.org> (raw)
In-Reply-To: <917EC07C-C9D9-4CF2-9ACB-DCA2676DFF67@oracle.com>
On Wed, 2024-01-24 at 13:55 +0000, Chuck Lever III wrote:
>
> > On Jan 24, 2024, at 6:24 AM, Jeff Layton <jlayton@kernel.org> wrote:
> >
> > On Wed, 2024-01-24 at 10:52 +0100, Lorenzo Bianconi wrote:
> > > [...]
> > > >
> > > > That's a great question. We do need to properly support the -H option to
> > > > rpc.nfsd. What we do today is look up the hostname or address using
> > > > getaddrinfo, and then open a listening socket for that address and then
> > > > pass that fd down to the kernel, which I think then takes the socket and
> > > > sticks it on sv_permsocks.
> > > >
> > > > All of that seems a bit klunky. Ideally, I'd say the best thing would be
> > > > to allow userland to pass the sockaddr we look up directly via netlink,
> > > > and then let the kernel open the socket. That will probably mean
> > > > refactoring some of the svc_xprt_create machinery to take a sockaddr,
> > > > but I don't think it looks too hard to do.
> > >
> > > Do we already have a specific use case for it? I think we can even add it
> > > later when we have a defined use case for it on top of the current series.
> > >
> >
> > Yes:
> >
> > rpc.nfsd -H makes nfsd listen on a particular address and port. By
> > passing down the sockaddr instead of an already-opened socket
> > descriptor, we can achieve the goal without having to open sockets in
> > userland.
>
> Tearing down a listener that was created that way would be a
> use case for:
>
> > Do we ever want/need to remove listening sockets?
> > Normal practice when making any changes is to stop and restart where
> > "stop" removes all sockets, unexports all filesystems, disables all
> > versions.
>
Good point. Even if we don't want to allow it today, passing down a
sockaddr over netlink gives us an interface to properly match a
listening socket for shutting them down without taking down the server.
It would be a little silly to make userland open a socket in order to
close the one that nfsd is listening on.
--
Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2024-01-24 18:10 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-20 17:33 [PATCH v6 0/3] convert write_threads, write_version and write_ports to netlink commands Lorenzo Bianconi
2024-01-20 17:33 ` [PATCH v6 1/3] NFSD: convert write_threads to netlink command Lorenzo Bianconi
2024-01-20 17:33 ` [PATCH v6 2/3] NFSD: add write_version " Lorenzo Bianconi
2024-01-22 13:27 ` Jeff Layton
2024-01-20 17:33 ` [PATCH v6 3/3] NFSD: add write_ports " Lorenzo Bianconi
2024-01-22 13:41 ` Jeff Layton
2024-01-22 15:35 ` Lorenzo Bianconi
2024-01-22 15:50 ` Jeff Layton
2024-01-22 15:59 ` Lorenzo Bianconi
2024-01-22 21:35 ` NeilBrown
2024-01-22 21:37 ` Jeff Layton
2024-01-22 22:58 ` Chuck Lever
2024-01-23 9:59 ` Lorenzo Bianconi
2024-01-23 11:17 ` Jeff Layton
2024-01-23 13:21 ` Lorenzo Bianconi
2024-01-23 14:28 ` Jeff Layton
2024-01-24 9:52 ` Lorenzo Bianconi
2024-01-24 11:24 ` Jeff Layton
2024-01-24 13:55 ` Chuck Lever III
2024-01-24 18:10 ` Jeff Layton [this message]
2024-01-25 22:44 ` NeilBrown
2024-01-26 2:38 ` Chuck Lever III
2024-01-26 7:27 ` NeilBrown
2024-01-26 13:58 ` Chuck Lever III
2024-01-22 16:31 ` kernel test robot
2024-01-22 13:49 ` [PATCH v6 0/3] convert write_threads, write_version and write_ports to netlink commands Jeff Layton
2024-01-22 17:01 ` Lorenzo Bianconi
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=55283b0a01d3b3ae2eb965929a6d81256a48b11e.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=lorenzo.bianconi@redhat.com \
--cc=lorenzo@kernel.org \
--cc=neilb@suse.de \
--cc=netdev@vger.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;
as well as URLs for NNTP newsgroup(s).