mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: Namjae Jeon <linkinjeon@kernel.org>, Hyunchul Lee <hyc.lee@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	ntfs@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH] ntfs: avoid unnecessary padding in uapi structure
Date: Tue, 13 Oct 2026 22:49:17 +0200	[thread overview]
Message-ID: <20261013204931.2287813-1-arnd@kernel.org> (raw)

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


             reply	other threads:[~2026-10-13 20:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-13 20:49 Arnd Bergmann [this message]
2026-10-13 23:38 ` liubaolin
2026-10-14 12:45 ` Namjae Jeon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261013204931.2287813-1-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=arnd@arndb.de \
    --cc=hyc.lee@gmail.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ntfs@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®