[PATCH] nfs: flexfilelayout: fix unused-but-set variable 'err'
From: Kenner de Azevedo dos Santos Miranda
Date: Tue Apr 28 2026 - 16:00:39 EST
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.
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@xxxxxxxxx>
---
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