public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Gruenbacher <agruen@suse.de>
To: Eric Paris <eparis@redhat.com>
Cc: linux-kernel@vger.kernel.org, Andreas Dilger <adilger@dilger.ca>,
	Tvrtko Ursulin <tvrtko.ursulin@sophos.com>
Subject: Re: [PATCH 4/4] fanotify: drops the packed attribute from userspace event metadata
Date: Mon, 23 Aug 2010 18:13:39 +0200	[thread overview]
Message-ID: <201008231813.39759.agruen@suse.de> (raw)
In-Reply-To: <1282523830-27751-4-git-send-email-eparis@redhat.com>

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

  reply	other threads:[~2010-08-23 16:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-23  0:37 [PATCH 1/4] fanotify: flush outstanding perm requests on group destroy Eric Paris
2010-08-23  0:37 ` [PATCH 2/4] fanotify: drop duplicate pr_debug statement Eric Paris
2010-08-23  0:37   ` [PATCH 3/4] fanotify: resize pid and reorder structure Eric Paris
2010-08-23  0:37     ` [PATCH 4/4] fanotify: drops the packed attribute from userspace event metadata Eric Paris
2010-08-23 16:13       ` Andreas Gruenbacher [this message]
2010-08-24  1:13 ` [PATCH 1/4] fanotify: flush outstanding perm requests on group destroy Andreas Gruenbacher
2010-08-24  8:49   ` Tvrtko Ursulin
2010-08-24  9:36     ` Andreas Gruenbacher
2010-08-24  9:51       ` Tvrtko Ursulin

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=201008231813.39759.agruen@suse.de \
    --to=agruen@suse.de \
    --cc=adilger@dilger.ca \
    --cc=eparis@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tvrtko.ursulin@sophos.com \
    /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