All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
To: Linus Torvalds
	<torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
Cc: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>,
	Alexander Viro
	<viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org>,
	Linux API <linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-fsdevel
	<linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Linux Kernel Mailing List
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	libc-alpha <libc-alpha-9JcytcrH/bA+uJoB2kUjGw@public.gmane.org>
Subject: Re: RFC: reject unknown open flags
Date: Thu, 30 Mar 2017 20:26:20 +0200	[thread overview]
Message-ID: <20170330182620.GA25251@lst.de> (raw)
In-Reply-To: <CA+55aFyg5sXb2vjW9Wt45asoveV7E1scqmph6Op6ZFYdGNwsEg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Thu, Mar 30, 2017 at 11:19:53AM -0700, Linus Torvalds wrote:
> So quite frankly, I'd much rather see that people who really want to
> check would instead just
> 
>      fd = open(... O_ATOMIC);
>      if (fd < 0)
>           .. regular error handling ..
> 
>      /* Did we actually get O_ATOMIC? */
>      if (!(O_ATOMIC & fnctl(fd, F_GETFL, NULL)))
>           .. warn about lack of O_ATOMIC ..
> 
> because I suspect that you will find users that might *want* atomic
> behavior, but in the absence of atomicity guarantees will want to
> still be able to do IO.

That would be nice, but still won't work as we blindly copy f_flags
into F_GETFL, not even masking our internal FMODE_ bits.

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Christoph Hellwig <hch@lst.de>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Linux API <linux-api@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	libc-alpha <libc-alpha@sourceware.org>
Subject: Re: RFC: reject unknown open flags
Date: Thu, 30 Mar 2017 20:26:20 +0200	[thread overview]
Message-ID: <20170330182620.GA25251@lst.de> (raw)
In-Reply-To: <CA+55aFyg5sXb2vjW9Wt45asoveV7E1scqmph6Op6ZFYdGNwsEg@mail.gmail.com>

On Thu, Mar 30, 2017 at 11:19:53AM -0700, Linus Torvalds wrote:
> So quite frankly, I'd much rather see that people who really want to
> check would instead just
> 
>      fd = open(... O_ATOMIC);
>      if (fd < 0)
>           .. regular error handling ..
> 
>      /* Did we actually get O_ATOMIC? */
>      if (!(O_ATOMIC & fnctl(fd, F_GETFL, NULL)))
>           .. warn about lack of O_ATOMIC ..
> 
> because I suspect that you will find users that might *want* atomic
> behavior, but in the absence of atomicity guarantees will want to
> still be able to do IO.

That would be nice, but still won't work as we blindly copy f_flags
into F_GETFL, not even masking our internal FMODE_ bits.

  parent reply	other threads:[~2017-03-30 18:26 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-30 16:33 RFC: reject unknown open flags Christoph Hellwig
2017-03-30 16:33 ` Christoph Hellwig
2017-03-30 16:33 ` [PATCH 1/2] fs: add a VALID_OPEN_FLAGS Christoph Hellwig
2017-03-30 16:33 ` [PATCH 2/2] fs: reject unknown open flags Christoph Hellwig
     [not found]   ` <20170330163327.23920-3-hch-jcswGhMUV9g@public.gmane.org>
2017-03-30 17:03     ` Linus Torvalds
2017-03-30 17:03       ` Linus Torvalds
     [not found] ` <20170330163327.23920-1-hch-jcswGhMUV9g@public.gmane.org>
2017-03-30 17:08   ` RFC: " Linus Torvalds
2017-03-30 17:08     ` Linus Torvalds
     [not found]     ` <CA+55aFw92r4h4sNW41ifs31ixdZpNmaxY23KthB9R-LXNm7p-w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-30 17:21       ` Christoph Hellwig
2017-03-30 17:21         ` Christoph Hellwig
     [not found]         ` <20170330172159.GA24139-jcswGhMUV9g@public.gmane.org>
2017-03-30 18:19           ` Linus Torvalds
2017-03-30 18:19             ` Linus Torvalds
     [not found]             ` <CA+55aFyg5sXb2vjW9Wt45asoveV7E1scqmph6Op6ZFYdGNwsEg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-30 18:26               ` Christoph Hellwig [this message]
2017-03-30 18:26                 ` Christoph Hellwig
     [not found]                 ` <20170330182620.GA25251-jcswGhMUV9g@public.gmane.org>
2017-03-30 18:45                   ` Linus Torvalds
2017-03-30 18:45                     ` Linus Torvalds
2017-03-30 20:05                     ` Boaz Harrosh
2017-03-30 19:02             ` Paul Eggert
2017-03-30 19:14               ` Linus Torvalds
2017-03-30 19:22     ` Florian Weimer

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=20170330182620.GA25251@lst.de \
    --to=hch-jcswghmuv9g@public.gmane.org \
    --cc=libc-alpha-9JcytcrH/bA+uJoB2kUjGw@public.gmane.org \
    --cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org \
    /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.