linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] a corner case of open(2)
@ 2016-04-26 17:55 Al Viro
  2016-04-26 18:05 ` Cedric Blancher
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Al Viro @ 2016-04-26 17:55 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-fsdevel, linux-kernel

	According to POSIX (and behaviour on other Unices) the following
should succeed: open("/tmp", O_CREAT, 0) does not have O_EXCL and the pathname
does refer to existing object, so O_CREAT is ignored and the call is
equivalent to open("/tmp", 0), which succeeds.

	We have it rejected with EISDIR.  The thing is, the standard behaviour
is actually less messy wrt code, and do_last()/lookup_open()/atomic_open()
badly needs untangling.

	Another place where we produce a bogus EISDIR is O_CREAT|O_EXCL on
an existing directory.  POSIX (and other Unices) have EEXIST there.  In some
cases we produce EEXIST, in some - EISDIR.  Uniform EEXIST is actually easier.

	It is a change of user-visible behaviour, but I would be very
surprised if anything broke from that change.  And it would help to simplify
the awful mess we have in there.

	Comments?

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

end of thread, other threads:[~2016-05-02 21:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-26 17:55 [RFC] a corner case of open(2) Al Viro
2016-04-26 18:05 ` Cedric Blancher
2016-04-26 18:15   ` Al Viro
2016-04-26 18:41 ` Valdis.Kletnieks
2016-04-26 19:02   ` Al Viro
2016-04-26 19:25     ` Valdis.Kletnieks
2016-04-26 20:17       ` Al Viro
2016-04-27  5:34 ` Al Viro
2016-04-27  9:33   ` Miklos Szeredi
2016-04-27 19:29   ` another patch in #for-linus (was Re: [RFC] a corner case of open(2)) Al Viro
2016-05-02 21:48     ` Pavel Machek

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