From: Mike Snitzer <snitzer@kernel.org>
To: Jeff Layton <jlayton@kernel.org>
Cc: linux-nfs@vger.kernel.org, Chuck Lever <chuck.lever@oracle.com>,
Anna Schumaker <anna@kernel.org>,
Trond Myklebust <trondmy@hammerspace.com>,
NeilBrown <neilb@suse.de>,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v12 12/24] SUNRPC: replace program list with program array
Date: Wed, 21 Aug 2024 17:43:21 -0400 [thread overview]
Message-ID: <ZsZfeUhwb7BCXjBZ@kernel.org> (raw)
In-Reply-To: <ZsZQqmvbyWGSuybH@kernel.org>
On Wed, Aug 21, 2024 at 04:40:10PM -0400, Mike Snitzer wrote:
> On Wed, Aug 21, 2024 at 02:31:07PM -0400, Jeff Layton wrote:
> > On Mon, 2024-08-19 at 14:17 -0400, Mike Snitzer wrote:
> > > From: NeilBrown <neil@brown.name>
> > >
> > > A service created with svc_create_pooled() can be given a linked list of
> > > programs and all of these will be served.
> > >
> > > Using a linked list makes it cumbersome when there are several programs
> > > that can be optionally selected with CONFIG settings.
> > >
> > > After this patch is applied, API consumers must use only
> > > svc_create_pooled() when creating an RPC service that listens for more
> > > than one RPC program.
> > >
> > > Signed-off-by: NeilBrown <neil@brown.name>
> > > Signed-off-by: Mike Snitzer <snitzer@kernel.org>
> > > ---
> > > fs/nfsd/nfsctl.c | 2 +-
> > > fs/nfsd/nfsd.h | 2 +-
> > > fs/nfsd/nfssvc.c | 67 +++++++++++++++++--------------------
> > > include/linux/sunrpc/svc.h | 7 ++--
> > > net/sunrpc/svc.c | 68 ++++++++++++++++++++++----------------
> > > net/sunrpc/svc_xprt.c | 2 +-
> > > net/sunrpc/svcauth_unix.c | 3 +-
> > > 7 files changed, 79 insertions(+), 72 deletions(-)
> > >
> > > diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
> > > index 1c9e5b4bcb0a..64c1b4d649bc 100644
> > > --- a/fs/nfsd/nfsctl.c
> > > +++ b/fs/nfsd/nfsctl.c
> > > @@ -2246,7 +2246,7 @@ static __net_init int nfsd_net_init(struct net *net)
> > > if (retval)
> > > goto out_repcache_error;
> > > memset(&nn->nfsd_svcstats, 0, sizeof(nn->nfsd_svcstats));
> > > - nn->nfsd_svcstats.program = &nfsd_program;
> > > + nn->nfsd_svcstats.program = &nfsd_programs[0];
> > > for (i = 0; i < sizeof(nn->nfsd_versions); i++)
> > > nn->nfsd_versions[i] = nfsd_support_version(i);
> > > for (i = 0; i < sizeof(nn->nfsd4_minorversions); i++)
> > > diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h
> > > index f87a359d968f..232a873dc53a 100644
> > > --- a/fs/nfsd/nfsd.h
> > > +++ b/fs/nfsd/nfsd.h
> > > @@ -85,7 +85,7 @@ struct nfsd_genl_rqstp {
> > > u32 rq_opnum[NFSD_MAX_OPS_PER_COMPOUND];
> > > };
> > >
> > > -extern struct svc_program nfsd_program;
> > > +extern struct svc_program nfsd_programs[];
> > > extern const struct svc_version nfsd_version2, nfsd_version3, nfsd_version4;
> > > extern struct mutex nfsd_mutex;
> > > extern spinlock_t nfsd_drc_lock;
> > > diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
> > > index 1bec3a53e35f..5f8680ab1013 100644
> > > --- a/fs/nfsd/nfssvc.c
> > > +++ b/fs/nfsd/nfssvc.c
> > > @@ -35,7 +35,6 @@
> > > #define NFSDDBG_FACILITY NFSDDBG_SVC
> > >
> > > atomic_t nfsd_th_cnt = ATOMIC_INIT(0);
> > > -extern struct svc_program nfsd_program;
> > > static int nfsd(void *vrqstp);
> > > #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
> > > static int nfsd_acl_rpcbind_set(struct net *,
> > > @@ -87,16 +86,6 @@ static const struct svc_version *localio_versions[] = {
> > >
> > > #define NFSD_LOCALIO_NRVERS ARRAY_SIZE(localio_versions)
> > >
> > > -static struct svc_program nfsd_localio_program = {
> > > - .pg_prog = NFS_LOCALIO_PROGRAM,
> > > - .pg_nvers = NFSD_LOCALIO_NRVERS,
> > > - .pg_vers = localio_versions,
> > > - .pg_name = "nfslocalio",
> > > - .pg_class = "nfsd",
> > > - .pg_authenticate = &svc_set_client,
> > > - .pg_init_request = svc_generic_init_request,
> > > - .pg_rpcbind_set = svc_generic_rpcbind_set,
> > > -};
> > > #endif /* CONFIG_NFSD_LOCALIO */
> > >
> > > #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
> > > @@ -109,23 +98,9 @@ static const struct svc_version *nfsd_acl_version[] = {
> > > # endif
> > > };
> > >
> > > -#define NFSD_ACL_MINVERS 2
> > > +#define NFSD_ACL_MINVERS 2
> > > #define NFSD_ACL_NRVERS ARRAY_SIZE(nfsd_acl_version)
> > >
> > > -static struct svc_program nfsd_acl_program = {
> > > -#if IS_ENABLED(CONFIG_NFSD_LOCALIO)
> > > - .pg_next = &nfsd_localio_program,
> > > -#endif /* CONFIG_NFSD_LOCALIO */
> > > - .pg_prog = NFS_ACL_PROGRAM,
> > > - .pg_nvers = NFSD_ACL_NRVERS,
> > > - .pg_vers = nfsd_acl_version,
> > > - .pg_name = "nfsacl",
> > > - .pg_class = "nfsd",
> > > - .pg_authenticate = &svc_set_client,
> > > - .pg_init_request = nfsd_acl_init_request,
> > > - .pg_rpcbind_set = nfsd_acl_rpcbind_set,
> > > -};
> > > -
> >
> > You just added this code in patch 11.
> >
> > I think it'd be clearer to reverse the order of patches 11 and 12. That
> > way you don't have this interim version of the localio program that
> > lives on the linked list.
>
> You may recall that these changes developed over time. This patch
> from Neil came after because he saw a way to make things better.
> Inverting/inserting patches earlier to reduce "churn" loses the
> development history. (It also introduces possibility to cause some
> regression or break bisect-ability.)
>
> It'd be one thing if I wrote every patch in this series, but I built
> on others' work and then others upon that. Preserving development
> history and attribution is something I've always tried to do.
> Otherwise changes get attributed to the wrong person.
>
> SO in this instance, I'd prefer to keep Neil's contribution as-is and
> avoid switching patch 12 and 11.
Looked closer, Neil is a co-developer on the preceding patch (happened
as side-effect of a different rebase some iterations ago). So I'm
fine with switching patches 11 and 12 like you suggested. It does
make things cleaner.
Thanks,
Mike
next prev parent reply other threads:[~2024-08-21 21:43 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-19 18:17 [PATCH v12 00/24] nfs/nfsd: add support for localio Mike Snitzer
2024-08-19 18:17 ` [PATCH v12 01/24] nfs_common: factor out nfs_errtbl and nfs_stat_to_errno Mike Snitzer
2024-08-19 18:17 ` [PATCH v12 02/24] nfs_common: factor out nfs4_errtbl and nfs4_stat_to_errno Mike Snitzer
2024-08-19 18:17 ` [PATCH v12 03/24] nfs: factor out {encode,decode}_opaque_fixed to nfs_xdr.h Mike Snitzer
2024-08-19 18:17 ` [PATCH v12 04/24] nfsd: factor out __fh_verify to allow NULL rqstp to be passed Mike Snitzer
2024-08-19 18:17 ` [PATCH v12 05/24] nfsd: fix nfsfh tracepoints to properly handle NULL rqstp Mike Snitzer
2024-08-21 17:46 ` Jeff Layton
2024-08-21 21:23 ` Mike Snitzer
2024-08-22 15:07 ` Chuck Lever
2024-08-22 16:04 ` Mike Snitzer
2024-08-22 17:07 ` Jeff Layton
2024-08-22 17:20 ` Mike Snitzer
2024-08-22 18:14 ` Chuck Lever III
2024-08-19 18:17 ` [PATCH v12 06/24] nfsd: add nfsd_file_acquire_local() Mike Snitzer
2024-08-19 18:17 ` [PATCH v12 07/24] SUNRPC: remove call_allocate() BUG_ONs Mike Snitzer
2024-08-19 18:17 ` [PATCH v12 08/24] SUNRPC: add rpcauth_map_clnt_to_svc_cred_local Mike Snitzer
2024-08-19 18:17 ` [PATCH v12 09/24] nfs_common: add NFS LOCALIO auxiliary protocol enablement Mike Snitzer
2024-08-21 18:04 ` Jeff Layton
2024-08-21 18:39 ` Jeff Layton
2024-08-19 18:17 ` [PATCH v12 10/24] nfsd: add localio support Mike Snitzer
2024-08-19 18:17 ` [PATCH v12 11/24] nfsd: implement server support for NFS_LOCALIO_PROGRAM Mike Snitzer
2024-08-19 18:17 ` [PATCH v12 12/24] SUNRPC: replace program list with program array Mike Snitzer
2024-08-21 18:31 ` Jeff Layton
2024-08-21 20:40 ` Mike Snitzer
2024-08-21 21:43 ` Mike Snitzer [this message]
2024-08-19 18:17 ` [PATCH v12 13/24] nfs: pass struct file to nfs_init_pgio and nfs_init_commit Mike Snitzer
2024-08-19 18:17 ` [PATCH v12 14/24] nfs: add localio support Mike Snitzer
2024-08-19 18:17 ` [PATCH v12 15/24] nfs: enable localio for non-pNFS IO Mike Snitzer
2024-08-19 18:17 ` [PATCH v12 16/24] pnfs/flexfiles: enable localio support Mike Snitzer
2024-08-19 18:17 ` [PATCH v12 17/24] nfs/localio: use dedicated workqueues for filesystem read and write Mike Snitzer
2024-08-19 18:17 ` [PATCH v12 18/24] nfs: implement client support for NFS_LOCALIO_PROGRAM Mike Snitzer
2024-08-19 18:17 ` [PATCH v12 19/24] nfs: add Documentation/filesystems/nfs/localio.rst Mike Snitzer
2024-08-19 18:17 ` [PATCH v12 20/24] nfsd: use GC for nfsd_file returned by nfsd_file_acquire_local Mike Snitzer
2024-08-21 18:34 ` Jeff Layton
2024-08-19 18:17 ` [PATCH v12 21/24] nfs_common: expose localio's required nfsd symbols to nfs client Mike Snitzer
2024-08-19 18:17 ` [PATCH v12 22/24] nfs: push localio nfsd_file_put call out to client Mike Snitzer
2024-08-21 18:50 ` Jeff Layton
2024-08-19 18:17 ` [PATCH v12 23/24] nfs: switch client to use nfsd_file for localio Mike Snitzer
2024-08-19 18:17 ` [PATCH v12 24/24] nfs: add FAQ section to Documentation/filesystems/nfs/localio.rst Mike Snitzer
2024-08-21 19:03 ` Jeff Layton
2024-08-21 20:12 ` Mike Snitzer
2024-08-21 20:14 ` Mike Snitzer
2024-08-21 23:46 ` Jeff Layton
2024-08-19 18:29 ` [PATCH v12 00/24] nfs/nfsd: add support for localio Chuck Lever III
2024-08-19 18:43 ` Mike Snitzer
2024-08-21 19:20 ` Jeff Layton
2024-08-21 20:05 ` Mike Snitzer
2024-08-22 12:35 ` Jeff Layton
2024-08-22 2:00 ` Mike Snitzer
2024-08-22 12:50 ` Jeff Layton
2024-08-22 15:18 ` Chuck Lever III
2024-08-22 15:42 ` Mike Snitzer
2024-08-21 19:56 ` Chuck Lever
2024-08-21 20:10 ` Mike Snitzer
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=ZsZfeUhwb7BCXjBZ@kernel.org \
--to=snitzer@kernel.org \
--cc=anna@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=jlayton@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
--cc=trondmy@hammerspace.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 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).