All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] NFSD: Fix warning unused SSC variables from kernel test robot.
@ 2021-04-19 21:35 Dai Ngo
  2021-04-19 21:40 ` Chuck Lever III
  0 siblings, 1 reply; 3+ messages in thread
From: Dai Ngo @ 2021-04-19 21:35 UTC (permalink / raw)
  To: bfields; +Cc: chuck.lever, linux-nfs

Compiler warning unused variables when NFS_V4_2 is configured and
NFSD_V4 is not:

fs/nfs/super.c:90:40: warning: unused variable 'nfs_ssc_clnt_ops_tbl'
static const struct nfs_ssc_client_ops nfs_ssc_clnt_ops_tbl = {

fs/nfs/nfs4file.c:410:41: warning: unused variable 'nfs4_ssc_clnt_ops_tbl'
static const struct nfs4_ssc_client_ops nfs4_ssc_clnt_ops_tbl = {

Fix by moving nfs_ssc_clnt_ops_tbl and nfs4_ssc_clnt_ops_tbl to
under NFSD_V4 since they are only used when NFSD_V4 is configured.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
---
 fs/nfs/nfs4file.c | 2 ++
 fs/nfs/super.c    | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c
index 441a2fa073c8..400c8db05808 100644
--- a/fs/nfs/nfs4file.c
+++ b/fs/nfs/nfs4file.c
@@ -313,6 +313,7 @@ static loff_t nfs42_remap_file_range(struct file *src_file, loff_t src_off,
 	return ret < 0 ? ret : count;
 }
 
+#ifdef CONFIG_NFSD_V4
 static int read_name_gen = 1;
 #define SSC_READ_NAME_BODY "ssc_read_%d"
 
@@ -411,6 +412,7 @@ static const struct nfs4_ssc_client_ops nfs4_ssc_clnt_ops_tbl = {
 	.sco_open = __nfs42_ssc_open,
 	.sco_close = __nfs42_ssc_close,
 };
+#endif	/* CONFIG_NFSD_V4 */
 
 /**
  * nfs42_ssc_register_ops - Wrapper to register NFS_V4 ops in nfs_common
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 94885c6f8f54..a7af01bad344 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -86,7 +86,7 @@ const struct super_operations nfs_sops = {
 };
 EXPORT_SYMBOL_GPL(nfs_sops);
 
-#ifdef CONFIG_NFS_V4_2
+#ifdef CONFIG_NFSD_V4
 static const struct nfs_ssc_client_ops nfs_ssc_clnt_ops_tbl = {
 	.sco_sb_deactive = nfs_sb_deactive,
 };
-- 
2.9.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] NFSD: Fix warning unused SSC variables from kernel test robot.
  2021-04-19 21:35 [PATCH 1/1] NFSD: Fix warning unused SSC variables from kernel test robot Dai Ngo
@ 2021-04-19 21:40 ` Chuck Lever III
  2021-04-19 22:01   ` Trond Myklebust
  0 siblings, 1 reply; 3+ messages in thread
From: Chuck Lever III @ 2021-04-19 21:40 UTC (permalink / raw)
  To: Dai Ngo; +Cc: Bruce Fields, Linux NFS Mailing List

Hello Dai-

> On Apr 19, 2021, at 5:35 PM, Dai Ngo <dai.ngo@oracle.com> wrote:
> 
> Compiler warning unused variables when NFS_V4_2 is configured and
> NFSD_V4 is not:
> 
> fs/nfs/super.c:90:40: warning: unused variable 'nfs_ssc_clnt_ops_tbl'
> static const struct nfs_ssc_client_ops nfs_ssc_clnt_ops_tbl = {
> 
> fs/nfs/nfs4file.c:410:41: warning: unused variable 'nfs4_ssc_clnt_ops_tbl'
> static const struct nfs4_ssc_client_ops nfs4_ssc_clnt_ops_tbl = {
> 
> Fix by moving nfs_ssc_clnt_ops_tbl and nfs4_ssc_clnt_ops_tbl to
> under NFSD_V4 since they are only used when NFSD_V4 is configured.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
> ---
> fs/nfs/nfs4file.c | 2 ++
> fs/nfs/super.c    | 2 +-
> 2 files changed, 3 insertions(+), 1 deletion(-)

I think because these are client-side source files, the patch
should go to Trond.


> diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c
> index 441a2fa073c8..400c8db05808 100644
> --- a/fs/nfs/nfs4file.c
> +++ b/fs/nfs/nfs4file.c
> @@ -313,6 +313,7 @@ static loff_t nfs42_remap_file_range(struct file *src_file, loff_t src_off,
> 	return ret < 0 ? ret : count;
> }
> 
> +#ifdef CONFIG_NFSD_V4
> static int read_name_gen = 1;
> #define SSC_READ_NAME_BODY "ssc_read_%d"
> 
> @@ -411,6 +412,7 @@ static const struct nfs4_ssc_client_ops nfs4_ssc_clnt_ops_tbl = {
> 	.sco_open = __nfs42_ssc_open,
> 	.sco_close = __nfs42_ssc_close,
> };
> +#endif	/* CONFIG_NFSD_V4 */
> 
> /**
>  * nfs42_ssc_register_ops - Wrapper to register NFS_V4 ops in nfs_common
> diff --git a/fs/nfs/super.c b/fs/nfs/super.c
> index 94885c6f8f54..a7af01bad344 100644
> --- a/fs/nfs/super.c
> +++ b/fs/nfs/super.c
> @@ -86,7 +86,7 @@ const struct super_operations nfs_sops = {
> };
> EXPORT_SYMBOL_GPL(nfs_sops);
> 
> -#ifdef CONFIG_NFS_V4_2
> +#ifdef CONFIG_NFSD_V4
> static const struct nfs_ssc_client_ops nfs_ssc_clnt_ops_tbl = {
> 	.sco_sb_deactive = nfs_sb_deactive,
> };
> -- 
> 2.9.5
> 

--
Chuck Lever




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] NFSD: Fix warning unused SSC variables from kernel test robot.
  2021-04-19 21:40 ` Chuck Lever III
@ 2021-04-19 22:01   ` Trond Myklebust
  0 siblings, 0 replies; 3+ messages in thread
From: Trond Myklebust @ 2021-04-19 22:01 UTC (permalink / raw)
  To: dai.ngo, chuck.lever; +Cc: bfields, linux-nfs

On Mon, 2021-04-19 at 21:40 +0000, Chuck Lever III wrote:
> Hello Dai-
> 
> > On Apr 19, 2021, at 5:35 PM, Dai Ngo <dai.ngo@oracle.com> wrote:
> > 
> > Compiler warning unused variables when NFS_V4_2 is configured and
> > NFSD_V4 is not:
> > 
> > fs/nfs/super.c:90:40: warning: unused variable
> > 'nfs_ssc_clnt_ops_tbl'
> > static const struct nfs_ssc_client_ops nfs_ssc_clnt_ops_tbl = {
> > 
> > fs/nfs/nfs4file.c:410:41: warning: unused variable
> > 'nfs4_ssc_clnt_ops_tbl'
> > static const struct nfs4_ssc_client_ops nfs4_ssc_clnt_ops_tbl = {
> > 
> > Fix by moving nfs_ssc_clnt_ops_tbl and nfs4_ssc_clnt_ops_tbl to
> > under NFSD_V4 since they are only used when NFSD_V4 is configured.
> > 
> > Reported-by: kernel test robot <lkp@intel.com>
> > Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
> > ---
> > fs/nfs/nfs4file.c | 2 ++
> > fs/nfs/super.c    | 2 +-
> > 2 files changed, 3 insertions(+), 1 deletion(-)
> 
> I think because these are client-side source files, the patch
> should go to Trond.
> 

I don't want anything in the NFS client that depends on CONFIG_NFSD. 

Now that I'm aware of the issue, I'd rather want to see a patch that
removes the existing CONFIG_NFSD_V4 #ifdefs from fs/nfs/nfs4file.c and
fs/nfs/super.c.
The code in fs/nfs_common was supposed to fix the problem of cross
coupling between the NFS client and server code, not add to it.

> 
> > diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c
> > index 441a2fa073c8..400c8db05808 100644
> > --- a/fs/nfs/nfs4file.c
> > +++ b/fs/nfs/nfs4file.c
> > @@ -313,6 +313,7 @@ static loff_t nfs42_remap_file_range(struct
> > file *src_file, loff_t src_off,
> >         return ret < 0 ? ret : count;
> > }
> > 
> > +#ifdef CONFIG_NFSD_V4
> > static int read_name_gen = 1;
> > #define SSC_READ_NAME_BODY "ssc_read_%d"
> > 
> > @@ -411,6 +412,7 @@ static const struct nfs4_ssc_client_ops
> > nfs4_ssc_clnt_ops_tbl = {
> >         .sco_open = __nfs42_ssc_open,
> >         .sco_close = __nfs42_ssc_close,
> > };
> > +#endif /* CONFIG_NFSD_V4 */
> > 
> > /**
> >  * nfs42_ssc_register_ops - Wrapper to register NFS_V4 ops in
> > nfs_common
> > diff --git a/fs/nfs/super.c b/fs/nfs/super.c
> > index 94885c6f8f54..a7af01bad344 100644
> > --- a/fs/nfs/super.c
> > +++ b/fs/nfs/super.c
> > @@ -86,7 +86,7 @@ const struct super_operations nfs_sops = {
> > };
> > EXPORT_SYMBOL_GPL(nfs_sops);
> > 
> > -#ifdef CONFIG_NFS_V4_2
> > +#ifdef CONFIG_NFSD_V4
> > static const struct nfs_ssc_client_ops nfs_ssc_clnt_ops_tbl = {
> >         .sco_sb_deactive = nfs_sb_deactive,
> > };
> > -- 
> > 2.9.5
> > 
> 
> --
> Chuck Lever
> 
> 
> 

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-19 22:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-19 21:35 [PATCH 1/1] NFSD: Fix warning unused SSC variables from kernel test robot Dai Ngo
2021-04-19 21:40 ` Chuck Lever III
2021-04-19 22:01   ` Trond Myklebust

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.