From: Wu Fengguang <fengguang.wu@intel.com>
To: James Bottomley <James.Bottomley@suse.de>
Cc: Jamie Lokier <jamie@shareable.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"davem@davemloft.net" <davem@davemloft.net>,
"eparis@redhat.com" <eparis@redhat.com>,
"hch@infradead.org" <hch@infradead.org>,
"rdreier@cisco.com" <rdreier@cisco.com>,
"schwab@linux-m68k.org" <schwab@linux-m68k.org>,
"sfr@canb.auug.org.au" <sfr@canb.auug.org.au>
Subject: [PATCH] vfs: take O_NONBLOCK out of the O_* uniqueness test
Date: Sat, 4 Sep 2010 09:22:31 +0800 [thread overview]
Message-ID: <20100904012231.GA5425@localhost> (raw)
In-Reply-To: <1282888424.8133.386.camel@mulgrave.site>
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 <James.Bottomley@suse.de>
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 <jamie@shareable.org>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
---
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 |
prev parent reply other threads:[~2010-09-04 1:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-20 22:29 [patch 2/5] vfs: O_* bit numbers uniqueness check akpm
2010-08-26 23:22 ` James Bottomley
2010-08-27 1:27 ` Jamie Lokier
2010-08-27 5:53 ` James Bottomley
2010-09-04 1:22 ` Wu Fengguang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100904012231.GA5425@localhost \
--to=fengguang.wu@intel.com \
--cc=James.Bottomley@suse.de \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=eparis@redhat.com \
--cc=hch@infradead.org \
--cc=jamie@shareable.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=rdreier@cisco.com \
--cc=schwab@linux-m68k.org \
--cc=sfr@canb.auug.org.au \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).