* [PATCH v1 1/1] nfsd: Mark variable __maybe_unused to avoid W=1 build break
@ 2025-11-13 8:31 Andy Shevchenko
2025-11-13 13:55 ` Chuck Lever
2025-11-17 13:49 ` Chuck Lever
0 siblings, 2 replies; 8+ messages in thread
From: Andy Shevchenko @ 2025-11-13 8:31 UTC (permalink / raw)
To: Chuck Lever, linux-nfs, linux-kernel, llvm
Cc: Jeff Layton, NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey,
Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt,
Andy Shevchenko
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@linux.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;
struct svc_fh fh;
int err;
struct nfsd_net *nn = net_generic(net, nfsd_net_id);
--
2.50.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v1 1/1] nfsd: Mark variable __maybe_unused to avoid W=1 build break
2025-11-13 8:31 [PATCH v1 1/1] nfsd: Mark variable __maybe_unused to avoid W=1 build break Andy Shevchenko
@ 2025-11-13 13:55 ` Chuck Lever
2025-11-17 13:49 ` Chuck Lever
1 sibling, 0 replies; 8+ messages in thread
From: Chuck Lever @ 2025-11-13 13:55 UTC (permalink / raw)
To: Andy Shevchenko, linux-nfs, linux-kernel, llvm
Cc: Jeff Layton, NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey,
Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt
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@linux.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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1 1/1] nfsd: Mark variable __maybe_unused to avoid W=1 build break
2025-11-13 8:31 [PATCH v1 1/1] nfsd: Mark variable __maybe_unused to avoid W=1 build break Andy Shevchenko
2025-11-13 13:55 ` Chuck Lever
@ 2025-11-17 13:49 ` Chuck Lever
2025-11-27 7:50 ` Andy Shevchenko
1 sibling, 1 reply; 8+ messages in thread
From: Chuck Lever @ 2025-11-17 13:49 UTC (permalink / raw)
To: linux-nfs, linux-kernel, llvm, Andy Shevchenko
Cc: Chuck Lever, Jeff Layton, NeilBrown, Olga Kornievskaia, Dai Ngo,
Tom Talpey, Nathan Chancellor, Nick Desaulniers, Bill Wendling,
Justin Stitt
From: Chuck Lever <chuck.lever@oracle.com>
On Thu, 13 Nov 2025 09:31:31 +0100, 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.
>
> [...]
Applied to nfsd-testing, thanks!
[1/1] nfsd: Mark variable __maybe_unused to avoid W=1 build break
commit: 56e9f88b25abf08de6f2b1bfbbb2ddc4e6622d1e
--
Chuck Lever
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1 1/1] nfsd: Mark variable __maybe_unused to avoid W=1 build break
2025-11-17 13:49 ` Chuck Lever
@ 2025-11-27 7:50 ` Andy Shevchenko
2025-11-27 16:20 ` Chuck Lever
0 siblings, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2025-11-27 7:50 UTC (permalink / raw)
To: Chuck Lever
Cc: linux-nfs, linux-kernel, llvm, Chuck Lever, Jeff Layton,
NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey,
Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt
On Mon, Nov 17, 2025 at 08:49:29AM -0500, Chuck Lever wrote:
> On Thu, 13 Nov 2025 09:31:31 +0100, 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.
[...]
> Applied to nfsd-testing, thanks!
>
> [1/1] nfsd: Mark variable __maybe_unused to avoid W=1 build break
> commit: 56e9f88b25abf08de6f2b1bfbbb2ddc4e6622d1e
Thanks, but still no appearance in Linux Next and problem seems to be present.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1 1/1] nfsd: Mark variable __maybe_unused to avoid W=1 build break
2025-11-27 7:50 ` Andy Shevchenko
@ 2025-11-27 16:20 ` Chuck Lever
2025-11-27 16:55 ` Andy Shevchenko
0 siblings, 1 reply; 8+ messages in thread
From: Chuck Lever @ 2025-11-27 16:20 UTC (permalink / raw)
To: Andy Shevchenko
Cc: linux-nfs, linux-kernel, llvm, Chuck Lever, Jeff Layton,
NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey,
Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt
On 11/27/25 2:50 AM, Andy Shevchenko wrote:
> On Mon, Nov 17, 2025 at 08:49:29AM -0500, Chuck Lever wrote:
>> On Thu, 13 Nov 2025 09:31:31 +0100, 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.
>
> [...]
>
>> Applied to nfsd-testing, thanks!
>>
>> [1/1] nfsd: Mark variable __maybe_unused to avoid W=1 build break
>> commit: 56e9f88b25abf08de6f2b1bfbbb2ddc4e6622d1e
>
> Thanks, but still no appearance in Linux Next and problem seems to be present.
>
The usual practice is to keep patches in nfsd-testing for four
weeks to allow NFSD and community CI processes to work, and to
enable extended review before it is merged. Both the community
CI processes (eg, zero-day bots) and the availability of
reviewers are not something I have control over.
It will be available for upstream merge after December 11. You
seem to be suggesting there is a sense of urgency so I will
direct it towards v6.20-rc as soon as it is merge-ready.
--
Chuck Lever
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1 1/1] nfsd: Mark variable __maybe_unused to avoid W=1 build break
2025-11-27 16:20 ` Chuck Lever
@ 2025-11-27 16:55 ` Andy Shevchenko
2025-11-27 17:08 ` Chuck Lever
0 siblings, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2025-11-27 16:55 UTC (permalink / raw)
To: Chuck Lever
Cc: linux-nfs, linux-kernel, llvm, Chuck Lever, Jeff Layton,
NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey,
Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt
On Thu, Nov 27, 2025 at 11:20:16AM -0500, Chuck Lever wrote:
> On 11/27/25 2:50 AM, Andy Shevchenko wrote:
> > On Mon, Nov 17, 2025 at 08:49:29AM -0500, Chuck Lever wrote:
> >> On Thu, 13 Nov 2025 09:31:31 +0100, 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.
[...]
> >> Applied to nfsd-testing, thanks!
> >>
> >> [1/1] nfsd: Mark variable __maybe_unused to avoid W=1 build break
> >> commit: 56e9f88b25abf08de6f2b1bfbbb2ddc4e6622d1e
> >
> > Thanks, but still no appearance in Linux Next and problem seems to be present.
> >
>
> The usual practice is to keep patches in nfsd-testing for four
> weeks to allow NFSD and community CI processes to work, and to
> enable extended review before it is merged. Both the community
> CI processes (eg, zero-day bots) and the availability of
> reviewers are not something I have control over.
>
> It will be available for upstream merge after December 11. You
> seem to be suggesting there is a sense of urgency so I will
> direct it towards v6.20-rc as soon as it is merge-ready.
Since it's (not so critical TBH, but still) a build breakage I supposed this to
go via the respective -fixes path. But okay, your call.
So far I will keep a patch locally to remember to annoy you :-) if it isn't applied
TL;DR: Thanks for the explanation.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1 1/1] nfsd: Mark variable __maybe_unused to avoid W=1 build break
2025-11-27 16:55 ` Andy Shevchenko
@ 2025-11-27 17:08 ` Chuck Lever
2025-11-27 18:03 ` Andy Shevchenko
0 siblings, 1 reply; 8+ messages in thread
From: Chuck Lever @ 2025-11-27 17:08 UTC (permalink / raw)
To: Andy Shevchenko
Cc: linux-nfs, linux-kernel, llvm, Chuck Lever, Jeff Layton,
NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey,
Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt
On 11/27/25 11:55 AM, Andy Shevchenko wrote:
> On Thu, Nov 27, 2025 at 11:20:16AM -0500, Chuck Lever wrote:
>> On 11/27/25 2:50 AM, Andy Shevchenko wrote:
>>> On Mon, Nov 17, 2025 at 08:49:29AM -0500, Chuck Lever wrote:
>>>> On Thu, 13 Nov 2025 09:31:31 +0100, 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.
>
> [...]
>
>>>> Applied to nfsd-testing, thanks!
>>>>
>>>> [1/1] nfsd: Mark variable __maybe_unused to avoid W=1 build break
>>>> commit: 56e9f88b25abf08de6f2b1bfbbb2ddc4e6622d1e
>>>
>>> Thanks, but still no appearance in Linux Next and problem seems to be present.
>>>
>>
>> The usual practice is to keep patches in nfsd-testing for four
>> weeks to allow NFSD and community CI processes to work, and to
>> enable extended review before it is merged. Both the community
>> CI processes (eg, zero-day bots) and the availability of
>> reviewers are not something I have control over.
>>
>> It will be available for upstream merge after December 11. You
>> seem to be suggesting there is a sense of urgency so I will
>> direct it towards v6.20-rc as soon as it is merge-ready.
Oops:
s/v6.20-rc/v6.19-rc/
> Since it's (not so critical TBH, but still) a build breakage I supposed this to
> go via the respective -fixes path.
Yes, what I meant above was I will submit it just after the
v6.19 merge window closes in a few weeks.
> But okay, your call.
It's just a build warning, but I know such issues affect the
Fedora and Red Hat kernel build pipelines, as they enable the
"warning => error" compile option.
However, those distributions enable SunRPC debugging, which
means they won't see it. So I think this problem is not likely
to be pervasive.
--
Chuck Lever
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1 1/1] nfsd: Mark variable __maybe_unused to avoid W=1 build break
2025-11-27 17:08 ` Chuck Lever
@ 2025-11-27 18:03 ` Andy Shevchenko
0 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2025-11-27 18:03 UTC (permalink / raw)
To: Chuck Lever
Cc: linux-nfs, linux-kernel, llvm, Chuck Lever, Jeff Layton,
NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey,
Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt
On Thu, Nov 27, 2025 at 12:08:09PM -0500, Chuck Lever wrote:
> On 11/27/25 11:55 AM, Andy Shevchenko wrote:
> > On Thu, Nov 27, 2025 at 11:20:16AM -0500, Chuck Lever wrote:
> >> On 11/27/25 2:50 AM, Andy Shevchenko wrote:
> >>> On Mon, Nov 17, 2025 at 08:49:29AM -0500, Chuck Lever wrote:
> >>>> On Thu, 13 Nov 2025 09:31:31 +0100, 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.
[...]
> >>>> Applied to nfsd-testing, thanks!
> >>>>
> >>>> [1/1] nfsd: Mark variable __maybe_unused to avoid W=1 build break
> >>>> commit: 56e9f88b25abf08de6f2b1bfbbb2ddc4e6622d1e
> >>>
> >>> Thanks, but still no appearance in Linux Next and problem seems to be present.
> >>>
> >>
> >> The usual practice is to keep patches in nfsd-testing for four
> >> weeks to allow NFSD and community CI processes to work, and to
> >> enable extended review before it is merged. Both the community
> >> CI processes (eg, zero-day bots) and the availability of
> >> reviewers are not something I have control over.
> >>
> >> It will be available for upstream merge after December 11. You
> >> seem to be suggesting there is a sense of urgency so I will
> >> direct it towards v6.20-rc as soon as it is merge-ready.
>
> Oops:
>
> s/v6.20-rc/v6.19-rc/
>
>
> > Since it's (not so critical TBH, but still) a build breakage I supposed this to
> > go via the respective -fixes path.
>
> Yes, what I meant above was I will submit it just after the
> v6.19 merge window closes in a few weeks.
Ah, that's wonderful, thanks!
> > But okay, your call.
>
> It's just a build warning, but I know such issues affect the
> Fedora and Red Hat kernel build pipelines, as they enable the
> "warning => error" compile option.
>
> However, those distributions enable SunRPC debugging, which
> means they won't see it. So I think this problem is not likely
> to be pervasive.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-11-27 18:03 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-13 8:31 [PATCH v1 1/1] nfsd: Mark variable __maybe_unused to avoid W=1 build break Andy Shevchenko
2025-11-13 13:55 ` Chuck Lever
2025-11-17 13:49 ` Chuck Lever
2025-11-27 7:50 ` Andy Shevchenko
2025-11-27 16:20 ` Chuck Lever
2025-11-27 16:55 ` Andy Shevchenko
2025-11-27 17:08 ` Chuck Lever
2025-11-27 18:03 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox