From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28521 invoked by alias); 30 Mar 2017 20:06:04 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 28508 invoked by uid 89); 30 Mar 2017 20:06:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM autolearn=no version=3.3.2 spammy=honored, 0017, Side, famous X-HELO: mail-wr0-f177.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=DHvXA0fhbogHxzIHqJOexlR9yh8AIh2ekQaQV9ubLY0=; b=ejQvK74p7mq8OtBN+rPdQXm1MdpBrijjBUmYVVgS7ko+1GZD9kopdK/k+N2YpRjjrR dRqjWsslQejENlUBDq+tCTCw2d1GW6azAA6Psy9juiqZpOZKSi2dOwYLeekI7YcujCWS dJI8Udf6KNBVpQeshR1pHPXVIRmzD/lhuVCEq+JhFedqPZBGYsmps6SOE2y6nMwTEXGO 6fQ/NIUgc/3qx9vum/GZxDjR5q82nBW+qwnwlWGcRpRomM/6amqo4SPm9ukdJKyT9haV 1CB7K06UALfm85E796KU+alnA6gEJlsH/cqrp0JAPMTU+jK92oUsOpcRbd96zflIaiT/ Zs9w== X-Gm-Message-State: AFeK/H3YhI/Lt1pCGGlMeZmejrADrHS2SJ77dBAwS7X7dBRVNDV53fvo8/WP5Kova7PlEA== X-Received: by 10.223.135.195 with SMTP id c3mr1353456wrc.41.1490904361889; Thu, 30 Mar 2017 13:06:01 -0700 (PDT) Subject: Re: RFC: reject unknown open flags To: Linus Torvalds , Christoph Hellwig References: <20170330163327.23920-1-hch@lst.de> <20170330172159.GA24139@lst.de> <20170330182620.GA25251@lst.de> Cc: Alexander Viro , Linux API , linux-fsdevel , Linux Kernel Mailing List , libc-alpha From: Boaz Harrosh Message-ID: <6cbf0110-eb29-9b18-8f92-7ddf1d6c5cc2@plexistor.com> Date: Thu, 30 Mar 2017 20:06:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-03/txt/msg00700.txt.bz2 On 03/30/2017 09:45 PM, Linus Torvalds wrote: > On Thu, Mar 30, 2017 at 11:26 AM, Christoph Hellwig wrote: >> >> 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. > > Ok, *that* is just silly of us, and we could try to just fix, and even backport. > > There's no possible valid use I could see where that should break > (famous last words - user code does some damn odd things at times). > > Of course, that won't fix old kernels that are out there, but then > neither would your original patch... > > Side note: I think you *can* detect the O_ATOMIC support by using > F_SETFL, because F_SETFL only allows you to change flags that we > recognize. So somebody who really wants to *guarantee* that O_ATOMIC > is there and honored even with old kernels could presumable do > something like > > fd = open(..); // *no* O_ATOMIC > fcnt(fd, F_SETFL, O_ATOMIC); > if (fcnt(fd, F_GETFL, NULL) & O_ATOMIC) > // Yay! We actually got it > else > // I guess we need to fall back on old behavior > > although I agree that that is ridiculously inconvenient and not a > great thing, and it's worth trying to aim for some better model. > Perhaps in that case it is time for an F_GETFL2 an F_GET_REAL_FL that gives you the nice simple user code Linus wanted for new applications. and solves forward and backwords for applications and Kernels? Just my $0.017 Boaz > Linus >