linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: sparc: Clashing values for O_PATH and FMODE_NONOTIFY?
       [not found] ` <20141119.153001.1273476178846053821.davem@davemloft.net>
@ 2014-11-20 12:12   ` David Drysdale
  2014-11-20 19:12     ` Eric Paris
  0 siblings, 1 reply; 3+ messages in thread
From: David Drysdale @ 2014-11-20 12:12 UTC (permalink / raw)
  To: David Miller, Eric Paris
  Cc: Alexander Viro, linux-kernel@vger.kernel.org, sparclinux,
	linux-fsdevel

[+linux-fsdevel, without the typo this time]

On Wed, Nov 19, 2014 at 8:30 PM, David Miller <davem@davemloft.net> wrote:
> From: David Drysdale <drysdale@google.com>
> Date: Tue, 18 Nov 2014 13:13:51 +0000
>
>> Hi folks,
>>
>> It looks like the value for O_PATH on sparc:
>>
>>   arch/sparc/include/uapi/asm/fcntl.h:37:#define O_PATH 0x1000000
>>
>> clashes with the arch-independent value for __FMODE_NONOTIFY:
>>
>>   include/linux/fs.h:137:#define FMODE_NONOTIFY ((__force fmode_t)0x1000000)
>>   include/linux/fs.h:2764:#define __FMODE_NONOTIFY ((__force int)
>> FMODE_NONOTIFY)
>>
>> and they are both in the same numbering space, as indicated by the
>> comment at the top of include/uapi/asm-generic/fcntl.h and the use in
>> fs/notify/fanotify/fanotify_user.c:715.
>>
>> Presumably this could theoretically cause problems (no notifications for
>> O_PATH files on SPARC?), so would it be a good idea to renumber
>> FMODE_NONOTIFY?  (I *think* that value is entirely kernel-internal.)
>>
>> Given that this has happened before (12ed2e36c98aec6c4155 "fanotify:
>> FMODE_NONOTIFY and __O_SYNC in sparc conflict") it would probably
>> also be a good idea to add __FMODE_NOTIFY to the uniqueness check in
>> fs/fcntl.c:fcntl_init().
>>
>> Thoughts?
>
> I think you will need to change the internal value, to not clash with
> the sparc exported one, for sure.

Well, I was sort of hoping someone else might volunteer to make the
change :-) --  I don't use fanotify (or sparc for that matter), I just
happened to notice the clash in passing.

But I'm happy to have a go, although I can't test much.  It would be
good to hear from the fanotify maintainers first, though -- Eric?

Thanks,
David

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: sparc: Clashing values for O_PATH and FMODE_NONOTIFY?
  2014-11-20 12:12   ` sparc: Clashing values for O_PATH and FMODE_NONOTIFY? David Drysdale
@ 2014-11-20 19:12     ` Eric Paris
  2014-11-20 19:31       ` David Drysdale
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Paris @ 2014-11-20 19:12 UTC (permalink / raw)
  To: David Drysdale
  Cc: David Miller, Alexander Viro, linux-kernel@vger.kernel.org,
	sparclinux, linux-fsdevel

On Thu, 2014-11-20 at 12:12 +0000, David Drysdale wrote:
> [+linux-fsdevel, without the typo this time]
> 
> On Wed, Nov 19, 2014 at 8:30 PM, David Miller <davem@davemloft.net> wrote:
> > From: David Drysdale <drysdale@google.com>
> > Date: Tue, 18 Nov 2014 13:13:51 +0000
> >
> >> Hi folks,
> >>
> >> It looks like the value for O_PATH on sparc:
> >>
> >>   arch/sparc/include/uapi/asm/fcntl.h:37:#define O_PATH 0x1000000
> >>
> >> clashes with the arch-independent value for __FMODE_NONOTIFY:
> >>
> >>   include/linux/fs.h:137:#define FMODE_NONOTIFY ((__force fmode_t)0x1000000)
> >>   include/linux/fs.h:2764:#define __FMODE_NONOTIFY ((__force int)
> >> FMODE_NONOTIFY)
> >>
> >> and they are both in the same numbering space, as indicated by the
> >> comment at the top of include/uapi/asm-generic/fcntl.h and the use in
> >> fs/notify/fanotify/fanotify_user.c:715.
> >>
> >> Presumably this could theoretically cause problems (no notifications for
> >> O_PATH files on SPARC?), so would it be a good idea to renumber
> >> FMODE_NONOTIFY?  (I *think* that value is entirely kernel-internal.)
> >>
> >> Given that this has happened before (12ed2e36c98aec6c4155 "fanotify:
> >> FMODE_NONOTIFY and __O_SYNC in sparc conflict") it would probably
> >> also be a good idea to add __FMODE_NOTIFY to the uniqueness check in
> >> fs/fcntl.c:fcntl_init().
> >>
> >> Thoughts?
> >
> > I think you will need to change the internal value, to not clash with
> > the sparc exported one, for sure.
> 
> Well, I was sort of hoping someone else might volunteer to make the
> change :-) --  I don't use fanotify (or sparc for that matter), I just
> happened to notice the clash in passing.
> 
> But I'm happy to have a go, although I can't test much.  It would be
> good to hear from the fanotify maintainers first, though -- Eric?

It's totally internal.  And was picked to not clash with anyone.  I
don't know how to keep it from happening in the future.....

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: sparc: Clashing values for O_PATH and FMODE_NONOTIFY?
  2014-11-20 19:12     ` Eric Paris
@ 2014-11-20 19:31       ` David Drysdale
  0 siblings, 0 replies; 3+ messages in thread
From: David Drysdale @ 2014-11-20 19:31 UTC (permalink / raw)
  To: Eric Paris
  Cc: David Miller, Alexander Viro, linux-kernel@vger.kernel.org,
	sparclinux, linux-fsdevel

On Thu, Nov 20, 2014 at 7:12 PM, Eric Paris <eparis@redhat.com> wrote:
> On Thu, 2014-11-20 at 12:12 +0000, David Drysdale wrote:
>> [+linux-fsdevel, without the typo this time]
>>
>> On Wed, Nov 19, 2014 at 8:30 PM, David Miller <davem@davemloft.net> wrote:
>> > From: David Drysdale <drysdale@google.com>
>> > Date: Tue, 18 Nov 2014 13:13:51 +0000
>> >
>> >> Hi folks,
>> >>
>> >> It looks like the value for O_PATH on sparc:
>> >>
>> >>   arch/sparc/include/uapi/asm/fcntl.h:37:#define O_PATH 0x1000000
>> >>
>> >> clashes with the arch-independent value for __FMODE_NONOTIFY:
>> >>
>> >>   include/linux/fs.h:137:#define FMODE_NONOTIFY ((__force fmode_t)0x1000000)
>> >>   include/linux/fs.h:2764:#define __FMODE_NONOTIFY ((__force int)
>> >> FMODE_NONOTIFY)
>> >>
>> >> and they are both in the same numbering space, as indicated by the
>> >> comment at the top of include/uapi/asm-generic/fcntl.h and the use in
>> >> fs/notify/fanotify/fanotify_user.c:715.
>> >>
>> >> Presumably this could theoretically cause problems (no notifications for
>> >> O_PATH files on SPARC?), so would it be a good idea to renumber
>> >> FMODE_NONOTIFY?  (I *think* that value is entirely kernel-internal.)
>> >>
>> >> Given that this has happened before (12ed2e36c98aec6c4155 "fanotify:
>> >> FMODE_NONOTIFY and __O_SYNC in sparc conflict") it would probably
>> >> also be a good idea to add __FMODE_NOTIFY to the uniqueness check in
>> >> fs/fcntl.c:fcntl_init().
>> >>
>> >> Thoughts?
>> >
>> > I think you will need to change the internal value, to not clash with
>> > the sparc exported one, for sure.
>>
>> Well, I was sort of hoping someone else might volunteer to make the
>> change :-) --  I don't use fanotify (or sparc for that matter), I just
>> happened to notice the clash in passing.
>>
>> But I'm happy to have a go, although I can't test much.  It would be
>> good to hear from the fanotify maintainers first, though -- Eric?
>
> It's totally internal.

OK, thanks, that makes me feel safer about changing its value.

(fatrace still seemed to work (and not report its own activity) after
I changed the value, which is also reassuring.)

> And was picked to not clash with anyone.  I
> don't know how to keep it from happening in the future.....

There's a compile-time check on the number of distinct O_*
bits at the bottom of fs/fcntl.c -- if we update that to include
FMODE_NONOTIFY then any future clashes should trigger
a (cross-)compilation failure.

I'll send out a patch tomorrow.

Thanks,
David

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-11-20 19:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CAHse=S_EY3mJ_pdZf+A46joro_uNy=6tXGG1v7Va4NX_YxJu2w@mail.gmail.com>
     [not found] ` <20141119.153001.1273476178846053821.davem@davemloft.net>
2014-11-20 12:12   ` sparc: Clashing values for O_PATH and FMODE_NONOTIFY? David Drysdale
2014-11-20 19:12     ` Eric Paris
2014-11-20 19:31       ` David Drysdale

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).