Linux-NFS Archive mirror
 help / color / mirror / Atom feed
From: "Anna Schumaker" <anna@kernel.org>
To: "Kenner de Azevedo dos Santos Miranda"
	<kenner.linuxdev@gmail.com>,
	"Trond Myklebust" <trondmy@kernel.org>
Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Jonathan Curley" <jcurley@purestorage.com>,
	"Tigran Mkrtchyan" <tigran.mkrtchyan@desy.de>,
	"Chuck Lever" <chuck.lever@oracle.com>,
	"Mike Snitzer" <snitzer@kernel.org>
Subject: Re: [PATCH] nfs: flexfilelayout: fix unused-but-set variable 'err'
Date: Wed, 29 Apr 2026 10:50:17 -0400	[thread overview]
Message-ID: <d5df5a69-5003-40dd-b23a-c88b6fe315a4@app.fastmail.com> (raw)
In-Reply-To: <20260428195919.29794-1-kenner.linuxdev@gmail.com>

Hi Kenner,

On Tue, Apr 28, 2026, at 3:59 PM, Kenner de Azevedo dos Santos Miranda wrote:
> The variable int err in f_layout_io_track_ds_error() is set but not 
> used in the code.
>
> The warning was identified by running make w=1:
>
>    warning: variable ‘err’ set but not used
>
> I set the (void)err to prevent the warning.

Wouldn't it be better to handle the error instead of ignoring it?

Thanks,
Anna

>
> I didn`t test with hardware, i ran again the make w=1 and the warning 
> was removed.
>
> Signed-off-by: Kenner de Azevedo dos Santos Miranda <kenner.linuxdev@gmail.com>
> ---
>  fs/nfs/flexfilelayout/flexfilelayout.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c 
> b/fs/nfs/flexfilelayout/flexfilelayout.c
> index 8b1559171fe3..d9a0fed41eac 100644
> --- a/fs/nfs/flexfilelayout/flexfilelayout.c
> +++ b/fs/nfs/flexfilelayout/flexfilelayout.c
> @@ -1536,6 +1536,7 @@ static void ff_layout_io_track_ds_error(struct 
> pnfs_layout_segment *lseg,
>  				       mirror, dss_id, offset, length, status, opnum,
>  				       nfs_io_gfp_mask());
> 
> +	(void)err;
>  	switch (status) {
>  	case NFS4ERR_DELAY:
>  	case NFS4ERR_GRACE:
> -- 
> 2.43.0

  reply	other threads:[~2026-04-29 14:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-28 19:59 [PATCH] nfs: flexfilelayout: fix unused-but-set variable 'err' Kenner de Azevedo dos Santos Miranda
2026-04-29 14:50 ` Anna Schumaker [this message]
2026-04-29 16:17   ` kenner azevedi

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=d5df5a69-5003-40dd-b23a-c88b6fe315a4@app.fastmail.com \
    --to=anna@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=jcurley@purestorage.com \
    --cc=kenner.linuxdev@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=snitzer@kernel.org \
    --cc=tigran.mkrtchyan@desy.de \
    --cc=trondmy@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 read-only IMAP folder(s) and NNTP newsgroup(s).