From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jamie Lokier Subject: Re: [patch 2/5] vfs: O_* bit numbers uniqueness check Date: Fri, 27 Aug 2010 02:27:00 +0100 Message-ID: <20100827012700.GK3574@shareable.org> References: <201007202229.o6KMTkEp021831@imap1.linux-foundation.org> <1282864959.8133.67.camel@mulgrave.site> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: akpm@linux-foundation.org, viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, fengguang.wu@intel.com, 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 mail2.shareable.org ([80.68.89.115]:60662 "EHLO mail2.shareable.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752255Ab0H0B1T (ORCPT ); Thu, 26 Aug 2010 21:27:19 -0400 Content-Disposition: inline In-Reply-To: <1282864959.8133.67.camel@mulgrave.site> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: James Bottomley wrote: > 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. A more thoroughly checking fix would be BUILD_BUG_ON(18 - 1 /* For O_RDONLY being 0 */ + HWEIGHT32(O_NONBLOCK) /* Because it's 2 bits on parisc */ != HWEIGHT32( .... all the bits .... )); Am I allowed to Sign-off handwavy pseudocode? ;-) -- Jamie