From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Bottomley Subject: Re: [patch 2/5] vfs: O_* bit numbers uniqueness check Date: Thu, 26 Aug 2010 18:22:39 -0500 Message-ID: <1282864959.8133.67.camel@mulgrave.site> References: <201007202229.o6KMTkEp021831@imap1.linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, fengguang.wu@intel.com, davem@davemloft.net, eparis@redhat.com, hch@infradead.org, jamie@shareable.org, rdreier@cisco.com, schwab@linux-m68k.org, sfr@canb.auug.org.au To: akpm@linux-foundation.org Return-path: Received: from cantor2.suse.de ([195.135.220.15]:44939 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754429Ab0HZXWy (ORCPT ); Thu, 26 Aug 2010 19:22:54 -0400 In-Reply-To: <201007202229.o6KMTkEp021831@imap1.linux-foundation.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, 2010-07-20 at 15:29 -0700, akpm@linux-foundation.org wrote: > From: Wu Fengguang > > The O_* bit numbers are defined in 20+ arch/*, and can silently overlap. > Add a compile time check to ensure the uniqueness as suggested by David > Miller. Can we get this reverted or fixed? It's causing the parisc compiles to fail. The reason is O_NONBLOCK on parisc has a dual value: #define O_NONBLOCK 000200004 /* HPUX has separate NDELAY & NONBLOCK */ The fix would be to take O_NONBLOCK out. James --- diff --git a/fs/fcntl.c b/fs/fcntl.c index 6769fd0..aeb02aa 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c @@ -770,10 +770,11 @@ EXPORT_SYMBOL(kill_fasync); static int __init fcntl_init(void) { /* please add new bits here to ensure allocation uniqueness */ - BUILD_BUG_ON(19 - 1 /* for O_RDONLY being 0 */ != HWEIGHT32( + BUILD_BUG_ON(18 - 1 /* for O_RDONLY being 0 */ != HWEIGHT32( O_RDONLY | O_WRONLY | O_RDWR | O_CREAT | O_EXCL | O_NOCTTY | - O_TRUNC | O_APPEND | O_NONBLOCK | + /* remove O_NONBLOCK it's a two bit define on parisc */ + O_TRUNC | O_APPEND | /* O_NONBLOCK | */ __O_SYNC | O_DSYNC | FASYNC | O_DIRECT | O_LARGEFILE | O_DIRECTORY | O_NOFOLLOW | O_NOATIME | O_CLOEXEC |