From: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Jan Kara <jack@suse.cz>, David Drysdale <drysdale@google.com>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Eric Paris <eparis@redhat.com>,
David Miller <davem@davemloft.net>, Arnd Bergmann <arnd@arndb.de>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
sparclinux@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCHv2 1/1] vfs: renumber FMODE_NONOTIFY and add to uniqueness check
Date: Thu, 25 Dec 2014 14:47:55 +0000 [thread overview]
Message-ID: <549C239B.8020204@gmx.de> (raw)
In-Reply-To: <20141124113008.GF1888@quack.suse.cz>
Hello Andrew,
could you, please, consider the patch proposed in
https://lkml.org/lkml/2014/11/24/196
for inclusion into the mm-tree.
This 2nd version of the patch considers the review comments in the
thread starting at https://lkml.org/lkml/2014/11/21/141.
Best regards
Heinrich Schuchardt
On 24.11.2014 12:30, Jan Kara wrote:
> On Mon 24-11-14 11:23:19, David Drysdale wrote:
>> Fix clashing values for O_PATH and FMODE_NONOTIFY on sparc.
>> The clashing O_PATH value was added in 5229645bdc35f1cc43eb ("vfs: add
>> nonconflicting values for O_PATH") but this can't be changed as it
>> is user-visible.
>>
>> FMODE_NONOTIFY is only used internally in the kernel, but it is in
>> the same numbering space as the other O_* flags, as indicated by the
>> comment at the top of include/uapi/asm-generic/fcntl.h (and its use
>> in fs/notify/fanotify/fanotify_user.c). So renumber it to avoid
>> the clash.
>>
>> All of this has happened before (12ed2e36c98aec6c4155, "fanotify:
>> FMODE_NONOTIFY and __O_SYNC in sparc conflict"), and all of this
>> will happen again -- so update the uniqueness check in fcntl_init()
>> to include __FMODE_NONOTIFY.
>>
>> Signed-off-by: David Drysdale <drysdale@google.com>
>> Acked-by: David S. Miller <davem@davemloft.net>
> Looks good. You can add:
> Acked-by: Jan Kara <jack@suse.cz>
>
> Honza
>
>> ---
>> fs/fcntl.c | 5 +++--
>> include/linux/fs.h | 2 +-
>> include/uapi/asm-generic/fcntl.h | 2 +-
>> 3 files changed, 5 insertions(+), 4 deletions(-)
>>
>> diff --git a/fs/fcntl.c b/fs/fcntl.c
>> index 99d440a4a6ba..ee85cd4e136a 100644
>> --- a/fs/fcntl.c
>> +++ b/fs/fcntl.c
>> @@ -740,14 +740,15 @@ static int __init fcntl_init(void)
>> * 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(20 - 1 /* for O_RDONLY being 0 */ != HWEIGHT32(
>> + BUILD_BUG_ON(21 - 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_SYNC | O_DSYNC | FASYNC |
>> O_DIRECT | O_LARGEFILE | O_DIRECTORY |
>> O_NOFOLLOW | O_NOATIME | O_CLOEXEC |
>> - __FMODE_EXEC | O_PATH | __O_TMPFILE
>> + __FMODE_EXEC | O_PATH | __O_TMPFILE |
>> + __FMODE_NONOTIFY
>> ));
>>
>> fasync_cache = kmem_cache_create("fasync_cache",
>> diff --git a/include/linux/fs.h b/include/linux/fs.h
>> index 9ab779e8a63c..fc1c2488adbc 100644
>> --- a/include/linux/fs.h
>> +++ b/include/linux/fs.h
>> @@ -134,7 +134,7 @@ typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
>> #define FMODE_CAN_WRITE ((__force fmode_t)0x40000)
>>
>> /* File was opened by fanotify and shouldn't generate fanotify events */
>> -#define FMODE_NONOTIFY ((__force fmode_t)0x1000000)
>> +#define FMODE_NONOTIFY ((__force fmode_t)0x4000000)
>>
>> /*
>> * Flag for rw_copy_check_uvector and compat_rw_copy_check_uvector
>> diff --git a/include/uapi/asm-generic/fcntl.h b/include/uapi/asm-generic/fcntl.h
>> index 7543b3e51331..e063effe0cc1 100644
>> --- a/include/uapi/asm-generic/fcntl.h
>> +++ b/include/uapi/asm-generic/fcntl.h
>> @@ -5,7 +5,7 @@
>>
>> /*
>> * FMODE_EXEC is 0x20
>> - * FMODE_NONOTIFY is 0x1000000
>> + * FMODE_NONOTIFY is 0x4000000
>> * These cannot be used by userspace O_* until internal and external open
>> * flags are split.
>> * -Eric Paris
>> --
>> 2.1.0.rc2.206.gedb03e5
>>
WARNING: multiple messages have this Message-ID (diff)
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: unlisted-recipients:; (no To-header on input)
Cc: Jan Kara <jack@suse.cz>, David Drysdale <drysdale@google.com>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Eric Paris <eparis@redhat.com>,
David Miller <davem@davemloft.net>, Arnd Bergmann <arnd@arndb.de>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
sparclinux@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCHv2 1/1] vfs: renumber FMODE_NONOTIFY and add to uniqueness check
Date: Thu, 25 Dec 2014 15:47:55 +0100 [thread overview]
Message-ID: <549C239B.8020204@gmx.de> (raw)
In-Reply-To: <20141124113008.GF1888@quack.suse.cz>
Hello Andrew,
could you, please, consider the patch proposed in
https://lkml.org/lkml/2014/11/24/196
for inclusion into the mm-tree.
This 2nd version of the patch considers the review comments in the
thread starting at https://lkml.org/lkml/2014/11/21/141.
Best regards
Heinrich Schuchardt
On 24.11.2014 12:30, Jan Kara wrote:
> On Mon 24-11-14 11:23:19, David Drysdale wrote:
>> Fix clashing values for O_PATH and FMODE_NONOTIFY on sparc.
>> The clashing O_PATH value was added in 5229645bdc35f1cc43eb ("vfs: add
>> nonconflicting values for O_PATH") but this can't be changed as it
>> is user-visible.
>>
>> FMODE_NONOTIFY is only used internally in the kernel, but it is in
>> the same numbering space as the other O_* flags, as indicated by the
>> comment at the top of include/uapi/asm-generic/fcntl.h (and its use
>> in fs/notify/fanotify/fanotify_user.c). So renumber it to avoid
>> the clash.
>>
>> All of this has happened before (12ed2e36c98aec6c4155, "fanotify:
>> FMODE_NONOTIFY and __O_SYNC in sparc conflict"), and all of this
>> will happen again -- so update the uniqueness check in fcntl_init()
>> to include __FMODE_NONOTIFY.
>>
>> Signed-off-by: David Drysdale <drysdale@google.com>
>> Acked-by: David S. Miller <davem@davemloft.net>
> Looks good. You can add:
> Acked-by: Jan Kara <jack@suse.cz>
>
> Honza
>
>> ---
>> fs/fcntl.c | 5 +++--
>> include/linux/fs.h | 2 +-
>> include/uapi/asm-generic/fcntl.h | 2 +-
>> 3 files changed, 5 insertions(+), 4 deletions(-)
>>
>> diff --git a/fs/fcntl.c b/fs/fcntl.c
>> index 99d440a4a6ba..ee85cd4e136a 100644
>> --- a/fs/fcntl.c
>> +++ b/fs/fcntl.c
>> @@ -740,14 +740,15 @@ static int __init fcntl_init(void)
>> * 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(20 - 1 /* for O_RDONLY being 0 */ != HWEIGHT32(
>> + BUILD_BUG_ON(21 - 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_SYNC | O_DSYNC | FASYNC |
>> O_DIRECT | O_LARGEFILE | O_DIRECTORY |
>> O_NOFOLLOW | O_NOATIME | O_CLOEXEC |
>> - __FMODE_EXEC | O_PATH | __O_TMPFILE
>> + __FMODE_EXEC | O_PATH | __O_TMPFILE |
>> + __FMODE_NONOTIFY
>> ));
>>
>> fasync_cache = kmem_cache_create("fasync_cache",
>> diff --git a/include/linux/fs.h b/include/linux/fs.h
>> index 9ab779e8a63c..fc1c2488adbc 100644
>> --- a/include/linux/fs.h
>> +++ b/include/linux/fs.h
>> @@ -134,7 +134,7 @@ typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
>> #define FMODE_CAN_WRITE ((__force fmode_t)0x40000)
>>
>> /* File was opened by fanotify and shouldn't generate fanotify events */
>> -#define FMODE_NONOTIFY ((__force fmode_t)0x1000000)
>> +#define FMODE_NONOTIFY ((__force fmode_t)0x4000000)
>>
>> /*
>> * Flag for rw_copy_check_uvector and compat_rw_copy_check_uvector
>> diff --git a/include/uapi/asm-generic/fcntl.h b/include/uapi/asm-generic/fcntl.h
>> index 7543b3e51331..e063effe0cc1 100644
>> --- a/include/uapi/asm-generic/fcntl.h
>> +++ b/include/uapi/asm-generic/fcntl.h
>> @@ -5,7 +5,7 @@
>>
>> /*
>> * FMODE_EXEC is 0x20
>> - * FMODE_NONOTIFY is 0x1000000
>> + * FMODE_NONOTIFY is 0x4000000
>> * These cannot be used by userspace O_* until internal and external open
>> * flags are split.
>> * -Eric Paris
>> --
>> 2.1.0.rc2.206.gedb03e5
>>
next prev parent reply other threads:[~2014-12-25 14:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-24 11:23 [PATCHv2 0/1] vfs: renumber FMODE_NONOTIFY and add to uniqueness check David Drysdale
2014-11-24 11:23 ` [PATCHv2 1/1] " David Drysdale
2014-11-24 11:30 ` Jan Kara
2014-11-24 11:30 ` Jan Kara
2014-12-25 14:47 ` Heinrich Schuchardt [this message]
2014-12-25 14:47 ` Heinrich Schuchardt
2015-01-07 0:29 ` Andrew Morton
2015-01-07 0:29 ` Andrew Morton
2015-01-08 9:06 ` David Drysdale
2015-01-08 9:06 ` David Drysdale
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=549C239B.8020204@gmx.de \
--to=xypron.glpk@gmx.de \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=davem@davemloft.net \
--cc=drysdale@google.com \
--cc=eparis@redhat.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sparclinux@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.