linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Dmitry Monakhov <dmonakhov@openvz.org>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/2] pipe: fix race with fcntl
Date: Sun, 12 Apr 2015 18:34:58 +0100	[thread overview]
Message-ID: <20150412173458.GO889@ZenIV.linux.org.uk> (raw)
In-Reply-To: <1428858502-5371-2-git-send-email-dmonakhov@openvz.org>

On Sun, Apr 12, 2015 at 09:08:21PM +0400, Dmitry Monakhov wrote:
> Fix other long standing issues caused by fcntl(,F_SETFL,):
> - User can disable O_DIRECT for pipe[1] (paketized IO), but can not enable it again.
> - Currently we do not set O_APPEND on pipe[1] (IMHO it is wrong, but let it be)
>   so it is reasonable to completely prohibit change O_APPEND flag on both
>   end's of pipe. Add ->check_flags method in order to diallow O_APPEND toggling.
> 
> Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
> ---

TBH, all those ->direct_IO != NULL checks seem to be a wrong approach.
If nothing else, it forces several filesystem into inventing a fake
->direct_IO just to fool those tests.  How about we
	* introduce FMODE_MAY_DIRECT and allow ->open() explicitly set it
	* make open_check_o_direct() and fcntl.c check that instead of poking
in ->f_mapping->a_ops, etc.
	* provide a variant of generic_file_open() that would set that
bit and use it on the filesystems that handle dio

  reply	other threads:[~2015-04-12 17:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-12 17:08 [PATCH 0/2] fs: make pipe/splice fcntl safe Dmitry Monakhov
2015-04-12 17:08 ` [PATCH 1/2] pipe: fix race with fcntl Dmitry Monakhov
2015-04-12 17:34   ` Al Viro [this message]
2015-04-12 17:52     ` Dmitry Monakhov
2015-04-12 17:08 ` [PATCH 2/2] splice: fix race beween splice_write vs fcntl Dmitry Monakhov

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=20150412173458.GO889@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=dmonakhov@openvz.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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 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).