]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
dlm: Avoid -Wflex-array-member-not-at-end warning
authorGustavo A. R. Silva <gustavoars@kernel.org>
Mon, 22 Sep 2025 14:20:47 +0000 (16:20 +0200)
committerDavid Teigland <teigland@redhat.com>
Mon, 2 Feb 2026 15:40:41 +0000 (09:40 -0600)
-Wflex-array-member-not-at-end was introduced in GCC-14, and we are
getting ready to enable it, globally.

Move the conflicting declaration to the end of the corresponding
structure. Notice that `struct dlm_message` is a flexible
structure, this is a structure that contains a flexible-array
member.

Fix the following warning:

fs/dlm/dlm_internal.h:609: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>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/dlm_internal.h

index d534a4bc162bba382c5ffab2335d7f1284c7abfe..9df842421ae06d988288ec2456bcf8ea00491832 100644 (file)
@@ -606,7 +606,6 @@ struct dlm_ls {
 
        struct dlm_rsb          ls_local_rsb;   /* for returning errors */
        struct dlm_lkb          ls_local_lkb;   /* for returning errors */
-       struct dlm_message      ls_local_ms;    /* for faking a reply */
 
        struct dentry           *ls_debug_rsb_dentry; /* debugfs */
        struct dentry           *ls_debug_waiters_dentry; /* debugfs */
@@ -665,6 +664,9 @@ struct dlm_ls {
 
        int                     ls_namelen;
        char                    ls_name[DLM_LOCKSPACE_LEN + 1];
+
+       /* Must be last --ends in a flexible-array member.*/
+       struct dlm_message      ls_local_ms;    /* for faking a reply */
 };
 
 /*