Messages in this thread | | | From | Andreas Gruenbacher <> | Subject | Re: [PATCH 4/4] fanotify: drops the packed attribute from userspace event metadata | Date | Mon, 23 Aug 2010 18:13:39 +0200 |
| |
On Monday 23 August 2010 02:37:10 Eric Paris wrote: > #define FANOTIFY_METADATA_VERSION 1
FANOTIFY_METADATA_VERSION should be incremented, too.
> struct fanotify_event_metadata { > __u32 event_len; > __u32 vers; > __u64 mask;
We don't actually care if there are any holes in this structure; all we care about is that the structure has the same alignment on 32-bit and 64-bit architectures.
Using type aligned_u64 here instead of __u64 will do the trick.
> +#ifdef __KERNEL__ > +/* see struct fanotify_event_metadata for the reason this exists */ > +struct fan_event_meta_packed { > + __u32 event_len; > + __u32 vers; > + __u64 mask; > + __s32 fd; > + __s32 pid; > +} __attribute__ ((packed));
This does not add much value; the two structures can still go out of sync A note to be careful about changes to struct fanotify_event_metadata should really be warning enough.
Andreas
| |