From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wu Fengguang Subject: [PATCH] vfs: take O_NONBLOCK out of the O_* uniqueness test Date: Sat, 4 Sep 2010 09:22:31 +0800 Message-ID: <20100904012231.GA5425@localhost> References: <201007202229.o6KMTkEp021831@imap1.linux-foundation.org> <1282864959.8133.67.camel@mulgrave.site> <20100827012700.GK3574@shareable.org> <1282888424.8133.386.camel@mulgrave.site> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jamie Lokier , "akpm@linux-foundation.org" , "viro@zeniv.linux.org.uk" , "linux-fsdevel@vger.kernel.org" , "davem@davemloft.net" , "eparis@redhat.com" , "hch@infradead.org" , "rdreier@cisco.com" , "schwab@linux-m68k.org" , "sfr@canb.auug.org.au" To: James Bottomley Return-path: Received: from mga14.intel.com ([143.182.124.37]:53278 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752212Ab0IDBWq (ORCPT ); Fri, 3 Sep 2010 21:22:46 -0400 Content-Disposition: inline In-Reply-To: <1282888424.8133.386.camel@mulgrave.site> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: I tend to agree with James' approach. How about this patch? Compile tested on x86. === vfs: take O_NONBLOCK out of the O_* uniqueness test From: James Bottomley O_NONBLOCK on parisc has a dual value: #define O_NONBLOCK 000200004 /* HPUX has separate NDELAY & NONBLOCK */ It is caught by the O_* bits uniqueness check and leads to a parisc compile error. The fix would be to take O_NONBLOCK out. Cc: Jamie Lokier Signed-off-by: Wu Fengguang Signed-off-by: James Bottomley --- fs/fcntl.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) --- linux-next.orig/fs/fcntl.c 2010-08-20 06:57:11.000000000 +0800 +++ linux-next/fs/fcntl.c 2010-09-04 09:16:09.000000000 +0800 @@ -769,11 +769,15 @@ 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( + /* + * Please add new bits here to ensure allocation uniqueness. + * Exceptions: O_NONBLOCK is a two bit define on parisc; O_NDELAY + * is defined as O_NONBLOCK on some platforms and not on others. + */ + 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 | + O_TRUNC | O_APPEND | /* O_NONBLOCK | */ __O_SYNC | O_DSYNC | FASYNC | O_DIRECT | O_LARGEFILE | O_DIRECTORY | O_NOFOLLOW | O_NOATIME | O_CLOEXEC |