diff options
| author | Gustavo A. R. Silva <gustavoars@kernel.org> | 2025-10-03 15:11:06 +0100 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2025-10-13 22:36:38 +0200 |
| commit | 8aec9dbf2db2e958de5bd20e23b8fbb8f2aa1fa6 (patch) | |
| tree | ac20695dc93ef43316ece1108bffc0c466bb4397 /fs/btrfs/send.c | |
| parent | btrfs: tree-checker: fix bounds check in check_inode_extref() (diff) | |
| download | linux-8aec9dbf2db2e958de5bd20e23b8fbb8f2aa1fa6.tar.gz linux-8aec9dbf2db2e958de5bd20e23b8fbb8f2aa1fa6.zip | |
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>
Diffstat (limited to 'fs/btrfs/send.c')
| -rw-r--r-- | fs/btrfs/send.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 9230e5066fc6..6144e66661f5 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -178,7 +178,6 @@ struct send_ctx { u64 cur_inode_rdev; u64 cur_inode_last_extent; u64 cur_inode_next_write_offset; - struct fs_path cur_inode_path; bool cur_inode_new; bool cur_inode_new_gen; bool cur_inode_deleted; @@ -305,6 +304,9 @@ struct send_ctx { struct btrfs_lru_cache dir_created_cache; struct btrfs_lru_cache dir_utimes_cache; + + /* Must be last as it ends in a flexible-array member. */ + struct fs_path cur_inode_path; }; struct pending_dir_move { |
