[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALXu0UdvkiMcXm2W0tQUEML2fxVYi2nr5zPu_K32xhk4zs-kLg@mail.gmail.com>
Date: Tue, 26 Apr 2016 20:05:50 +0200
From: Cedric Blancher <cedric.blancher@...il.com>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [RFC] a corner case of open(2)
Existing UNIX behaviour is better. Also, for open() a directory,
remember that int fd=open(), fchdir(fd) must work.
Ced
On 26 April 2016 at 19:55, Al Viro <viro@...iv.linux.org.uk> wrote:
> 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?
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Cedric Blancher <cedric.blancher@...il.com>
Institute Pasteur
Powered by blists - more mailing lists