archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <>
To: Al Viro <>
Cc: Arthur Williams <>,
Subject: Re: [PATCH] fs: Allow open with O_CREAT to succeed if existing dir is specified
Date: Sat, 19 Jun 2021 15:27:07 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Sat, Jun 19, 2021 at 12:42:14PM +0000, Al Viro wrote:
> On Sat, Jun 19, 2021 at 06:01:48AM -0500, Arthur Williams wrote:
> > Make opening a file with the O_CREAT flag a no-op if the specified file
> > exists even if it exists as a directory. Allows userspace commands, like
> > flock, to open a file and create it if it doesn't exist instead of
> > having to parse errno.
> Not going to happen.  It's a user-visible behaviour, consistent between
> all kinds of Unices, consistent with POSIX and it does make sense.
> NAK.

Agreed.  POSIX states:

    The named file is a directory and oflag includes O_WRONLY or O_RDWR, or includes O_CREAT without O_DIRECTORY.

so I would say the POSIX committee considered this situation and
explicitly did not want it to succeed.

  reply	other threads:[~2021-06-19 14:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-19 11:01 [PATCH] fs: Allow open with O_CREAT to succeed if existing dir is specified Arthur Williams
2021-06-19 12:42 ` Al Viro
2021-06-19 14:27   ` Matthew Wilcox [this message]
     [not found]   ` <>
2021-06-19 15:09     ` Al Viro
2021-07-01  2:19 ` [fs] 87f196bed3: kernel test robot
2021-07-01  9:48   ` David Sterba

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

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