Re: [patch 2/5] vfs: O_* bit numbers uniqueness check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2010-08-27 at 02:27 +0100, Jamie Lokier wrote:
> James Bottomley wrote:
> > On Tue, 2010-07-20 at 15:29 -0700, akpm@xxxxxxxxxxxxxxxxxxxx wrote:
> > > From: Wu Fengguang <fengguang.wu@xxxxxxxxx>
> > > 
> > > 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 ....     ));

Well, it works, but is it wise?  There are several missing flags in this
expression: O_NDELAY being the most noticeable one.  It's defined to be
the sames as O_NONBLOCK on some platforms and not on others.  Our
O_NONBLOCK problem is essentially the same class.

> Am I allowed to Sign-off handwavy pseudocode? ;-)

Nope ... you'd have to code it as a real patch ...

James


--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux