History

ext4: fix ext4_tune_sb_params padding

The padding at the end of struct ext4_tune_sb_params is architecture specific and in particular is different between x86-32 and x86-64, since the __u64 member only enforces struct alignment on the latter. This shows up as a new warning when test-building the headers with -Wpadded: include/linux/ext4.h:144:1: error: padding struct size to alignment boundary with 4 bytes [-Werror=padded] All members inside the structure are naturally aligned, so the only difference here is the amount of padding at the end. Make the padding explicit, to have a consistent sizeof(struct ext4_tune_sb_params) of 232 on all architectures and avoid adding compat ioctl handling for EXT4_IOC_GET_TUNE_SB_PARAM/EXT4_IOC_SET_TUNE_SB_PARAM. This is an ABI break on x86-32 but hopefully this can go into 6.18.y early enough as a fixup so no actual users will be affected. Alternatively, the kernel could handle the ioctl commands for both sizes (232 and 228 bytes) on all architectures.

Arnd Bergmann committed 11 months ago

Commit cd16edb1 parent 9ace4751 file · +1 −1Browse files

Showing the changes to include/uapi (1 of 1 file). Show all

Unified · Split

include/uapi/linux/ext4.h+1−1
@@ -139,7 +139,7 @@ struct ext4_tune_sb_params { · 138 unmodified lines
139 __u32 clear_feature_incompat_mask;139 __u32 clear_feature_incompat_mask;
140 __u32 clear_feature_ro_compat_mask;140 __u32 clear_feature_ro_compat_mask;
141 __u8 mount_opts[64];141 __u8 mount_opts[64];
142 __u8 pad[64];142 __u8 pad[68];
143};143};
144 144
145#define EXT4_TUNE_FL_ERRORS_BEHAVIOR 0x00000001145#define EXT4_TUNE_FL_ERRORS_BEHAVIOR 0x00000001

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t