]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
btrfs: send: fix -Wflex-array-member-not-at-end warning in struct send_ctx
authorGustavo A. R. Silva <gustavoars@kernel.org>
Fri, 3 Oct 2025 14:11:06 +0000 (15:11 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 13 Oct 2025 20:36:38 +0000 (22:36 +0200)
commit8aec9dbf2db2e958de5bd20e23b8fbb8f2aa1fa6
treeac20695dc93ef43316ece1108bffc0c466bb4397
parente92c2941204de7b62e9c2deecfeb9eaefe54a22a
btrfs: send: fix -Wflex-array-member-not-at-end warning in struct send_ctx

The warning -Wflex-array-member-not-at-end was introduced in GCC-14, and
we are getting ready to enable it, globally.

Fix the following warning:

  fs/btrfs/send.c:181:24: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

and move the declaration of send_ctx::cur_inode_path to the end.

Notice that struct fs_path contains a flexible array member inline_buf,
but also a padding array and a limit calculated for the usable space of
inline_buf (FS_PATH_INLINE_SIZE). It is not the pattern where flexible
array is in the middle of a structure and could potentially overwrite
other members.

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/send.c