]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
NFSD: Avoid multiple -Wflex-array-member-not-at-end warnings
authorGustavo A. R. Silva <gustavoars@kernel.org>
Mon, 16 Jun 2025 22:31:03 +0000 (16:31 -0600)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 14 Jul 2025 16:46:45 +0000 (12:46 -0400)
Replace flexible-array member with a fixed-size array.

With this changes, fix many instances of the following type of
warnings:

fs/nfsd/nfsfh.h:79:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
fs/nfsd/state.h:763:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
fs/nfsd/state.h:669:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
fs/nfsd/state.h:549:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
fs/nfsd/xdr4.h:705:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
fs/nfsd/xdr4.h:678:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfsfh.h

index 5103c2f4d2253a3c0650d5596ec3500a37a0af26..760e77f3630bc7d10a31a4c132155b8cfa483756 100644 (file)
@@ -56,7 +56,7 @@ struct knfsd_fh {
                        u8              fh_auth_type;   /* deprecated */
                        u8              fh_fsid_type;
                        u8              fh_fileid_type;
-                       u32             fh_fsid[]; /* flexible-array member */
+                       u32             fh_fsid[NFS4_FHSIZE / 4 - 1];
                };
        };
 };