Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754511Ab0HWQTR (ORCPT ); Mon, 23 Aug 2010 12:19:17 -0400 Received: from cantor.suse.de ([195.135.220.2]:46774 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754484Ab0HWQTQ (ORCPT ); Mon, 23 Aug 2010 12:19:16 -0400 From: Andreas Gruenbacher Organization: SUSE Labs To: Eric Paris Subject: Re: [PATCH 4/4] fanotify: drops the packed attribute from userspace event metadata Date: Mon, 23 Aug 2010 18:13:39 +0200 User-Agent: KMail/1.12.4 (Linux/2.6.31.12-0.2-desktop; KDE/4.3.5; i686; ; ) Cc: linux-kernel@vger.kernel.org, Andreas Dilger , Tvrtko Ursulin References: <1282523830-27751-1-git-send-email-eparis@redhat.com> <1282523830-27751-3-git-send-email-eparis@redhat.com> <1282523830-27751-4-git-send-email-eparis@redhat.com> In-Reply-To: <1282523830-27751-4-git-send-email-eparis@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201008231813.39759.agruen@suse.de> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1137 Lines: 36 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/