Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751962AbbDLRfD (ORCPT ); Sun, 12 Apr 2015 13:35:03 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:44996 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751855AbbDLRe7 (ORCPT ); Sun, 12 Apr 2015 13:34:59 -0400 Date: Sun, 12 Apr 2015 18:34:58 +0100 From: Al Viro To: Dmitry Monakhov Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 1/2] pipe: fix race with fcntl Message-ID: <20150412173458.GO889@ZenIV.linux.org.uk> References: <1428858502-5371-1-git-send-email-dmonakhov@openvz.org> <1428858502-5371-2-git-send-email-dmonakhov@openvz.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1428858502-5371-2-git-send-email-dmonakhov@openvz.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1236 Lines: 23 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 > --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/