From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: RFC: reject unknown open flags Date: Thu, 30 Mar 2017 20:26:20 +0200 Message-ID: <20170330182620.GA25251@lst.de> References: <20170330163327.23920-1-hch@lst.de> <20170330172159.GA24139@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Linus Torvalds Cc: Christoph Hellwig , Alexander Viro , Linux API , linux-fsdevel , Linux Kernel Mailing List , libc-alpha List-Id: linux-api@vger.kernel.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. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from verein.lst.de ([213.95.11.211]:59304 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934274AbdC3S0X (ORCPT ); Thu, 30 Mar 2017 14:26:23 -0400 Date: Thu, 30 Mar 2017 20:26:20 +0200 From: Christoph Hellwig To: Linus Torvalds Cc: Christoph Hellwig , Alexander Viro , Linux API , linux-fsdevel , Linux Kernel Mailing List , libc-alpha Subject: Re: RFC: reject unknown open flags Message-ID: <20170330182620.GA25251@lst.de> References: <20170330163327.23920-1-hch@lst.de> <20170330172159.GA24139@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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.