lkml.org 
[lkml]   [2015]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] pipe: fix race with fcntl
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


\
 
 \ /
  Last update: 2015-04-12 20:01    [W:0.031 / U:0.648 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site