Re: [PATCH v2] fs: pack fields `i_state` and `i_fsnotify_mask`
From: Max Kellermann
Date: Mon Nov 16 2026 - 02:53:06 EST
On Fri, Nov 13, 2026 at 9:34 PM David Laight
<david.laight.linux@xxxxxxxxx> wrote:
> I'd use a different workd than 'pack', made me think of __packed.
What word would you use?
I think GCC's "packed" attribute is confusing and the name is somewhat
misleading - yes, in the end the struct members will be "packed" which
makes it sound like a nice idea, but it's really about forcing member
alignment to be 1 byte, and accessing such fields is UB, which the GCC
documentation fails to mention...
> > +#ifdef CONFIG_FSNOTIFY
> > + __u32 i_fsnotify_mask; /* all events this inode cares about */
> > +
> > + struct fsnotify_mark_connector __rcu *i_fsnotify_marks;
>
> #else
> /* 32-bit hole */
Good idea, I'll re-add the comment in the next revision.
--
Max Kellermann
Principal Architect
Hosting Technology
cm4all | Im Mediapark 6a | 50670 Köln | Germany
General information about the company can be found here:
https://www.cm4all.com/impressum
A member of the IONOS Group