* [PATCH] ntfs: avoid unnecessary padding in uapi structure
@ 2026-10-13 20:49 Arnd Bergmann
2026-10-13 23:38 ` liubaolin
2026-10-14 12:45 ` Namjae Jeon
0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2026-10-13 20:49 UTC (permalink / raw)
To: Namjae Jeon, Hyunchul Lee; +Cc: Arnd Bergmann, ntfs, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
Building the uapi headers with -Wpadded shows a warning that
may indicate an incompatibility:
./usr/include/linux/ntfs.h:91:1: error: padding struct size to alignment boundary with 4 bytes [-Werror=padded]
This is relatively harmless here as the 64-bit members force natural
alignment, so this is not a problem for compat ioctls, and I checked
that the padding word is still initialized by means of using kvzalloc()
to allocate it, but it's better to avoid the padding out of
principle.
Change the reserved member to use a 64-bit type so the name field
starts after the structure and all padding is explicit.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
include/uapi/linux/ntfs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/uapi/linux/ntfs.h b/include/uapi/linux/ntfs.h
index f5b3d4997a56..89467ba07262 100644
--- a/include/uapi/linux/ntfs.h
+++ b/include/uapi/linux/ntfs.h
@@ -86,7 +86,7 @@ struct ntfs_stream_entry {
__aligned_u64 alloc_size;
__u32 name_len;
__u32 name_offset;
- __u32 reserved;
+ __aligned_u64 reserved;
__u8 name[];
};
--
2.53.0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] ntfs: avoid unnecessary padding in uapi structure
2026-10-13 20:49 [PATCH] ntfs: avoid unnecessary padding in uapi structure Arnd Bergmann
@ 2026-10-13 23:38 ` liubaolin
2026-10-14 12:45 ` Namjae Jeon
1 sibling, 0 replies; 3+ messages in thread
From: liubaolin @ 2026-10-13 23:38 UTC (permalink / raw)
To: Arnd Bergmann, Namjae Jeon, Hyunchul Lee
Cc: Arnd Bergmann, ntfs, linux-kernel
在 2026/10/14 04:49, Arnd Bergmann 写道:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Building the uapi headers with -Wpadded shows a warning that
> may indicate an incompatibility:
>
> ./usr/include/linux/ntfs.h:91:1: error: padding struct size to alignment boundary with 4 bytes [-Werror=padded]
>
> This is relatively harmless here as the 64-bit members force natural
> alignment, so this is not a problem for compat ioctls, and I checked
> that the padding word is still initialized by means of using kvzalloc()
> to allocate it, but it's better to avoid the padding out of
> principle.
>
> Change the reserved member to use a 64-bit type so the name field
> starts after the structure and all padding is explicit.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> include/uapi/linux/ntfs.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/uapi/linux/ntfs.h b/include/uapi/linux/ntfs.h
> index f5b3d4997a56..89467ba07262 100644
> --- a/include/uapi/linux/ntfs.h
> +++ b/include/uapi/linux/ntfs.h
> @@ -86,7 +86,7 @@ struct ntfs_stream_entry {
> __aligned_u64 alloc_size;
> __u32 name_len;
> __u32 name_offset;
> - __u32 reserved;
> + __aligned_u64 reserved;
> __u8 name[];
> };
>
Looks good to me.
Reviewed-by: Baolin Liu <liubaolin@kylinos.cn>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] ntfs: avoid unnecessary padding in uapi structure
2026-10-13 20:49 [PATCH] ntfs: avoid unnecessary padding in uapi structure Arnd Bergmann
2026-10-13 23:38 ` liubaolin
@ 2026-10-14 12:45 ` Namjae Jeon
1 sibling, 0 replies; 3+ messages in thread
From: Namjae Jeon @ 2026-10-14 12:45 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: Hyunchul Lee, Arnd Bergmann, ntfs, linux-kernel
On Wed, Oct 14, 2026 at 5:49 AM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> Building the uapi headers with -Wpadded shows a warning that
> may indicate an incompatibility:
>
> ./usr/include/linux/ntfs.h:91:1: error: padding struct size to alignment boundary with 4 bytes [-Werror=padded]
>
> This is relatively harmless here as the 64-bit members force natural
> alignment, so this is not a problem for compat ioctls, and I checked
> that the padding word is still initialized by means of using kvzalloc()
> to allocate it, but it's better to avoid the padding out of
> principle.
>
> Change the reserved member to use a 64-bit type so the name field
> starts after the structure and all padding is explicit.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied it to #ntfs-next.
Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-14 12:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-13 20:49 [PATCH] ntfs: avoid unnecessary padding in uapi structure Arnd Bergmann
2026-10-13 23:38 ` liubaolin
2026-10-14 12:45 ` Namjae Jeon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®