lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <28311b28-f6f9-4d41-9ef6-c1977b932073@oracle.com>
Date: Thu, 13 Nov 2025 08:55:50 -0500
From: Chuck Lever <chuck.lever@...cle.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        linux-nfs@...r.kernel.org, linux-kernel@...r.kernel.org,
        llvm@...ts.linux.dev
Cc: Jeff Layton <jlayton@...nel.org>, NeilBrown <neil@...wn.name>,
        Olga Kornievskaia <okorniev@...hat.com>, Dai Ngo <Dai.Ngo@...cle.com>,
        Tom Talpey <tom@...pey.com>, Nathan Chancellor <nathan@...nel.org>,
        Nick Desaulniers <nick.desaulniers+lkml@...il.com>,
        Bill Wendling <morbo@...gle.com>,
        Justin Stitt <justinstitt@...gle.com>
Subject: Re: [PATCH v1 1/1] nfsd: Mark variable __maybe_unused to avoid W=1
 build break

On 11/13/25 3:31 AM, Andy Shevchenko wrote:
> Clang is not happy about set but (in some cases) unused variable:
> 
> fs/nfsd/export.c:1027:17: error: variable 'inode' set but not used [-Werror,-Wunused-but-set-variable]
> 
> since it's used as a parameter to dprintk() which might be configured
> a no-op. To avoid uglifying code with the specific ifdeffery just mark
> the variable __maybe_unused.
> 
> The commit [1], which introduced this behaviour, is quite old and hence
> the Fixes tag points to the first of Git era.
> 
> Link: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?id=0431923fb7a1 [1]
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
>  fs/nfsd/export.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
> index 9d55512d0cc9..2a1499f2ad19 100644
> --- a/fs/nfsd/export.c
> +++ b/fs/nfsd/export.c
> @@ -1024,7 +1024,7 @@ exp_rootfh(struct net *net, struct auth_domain *clp, char *name,
>  {
>  	struct svc_export	*exp;
>  	struct path		path;
> -	struct inode		*inode;
> +	struct inode		*inode __maybe_unused;

We typically use "#ifdef CONFIG_SUNRPC_DEBUG" instead for this purpose.
I don't think that would be terribly out of place.


>  	struct svc_fh		fh;
>  	int			err;
>  	struct nfsd_net		*nn = net_generic(net, nfsd_net_id);


-- 
Chuck Lever

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ