Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752646AbcKRI7b (ORCPT ); Fri, 18 Nov 2016 03:59:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54414 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751574AbcKRI71 (ORCPT ); Fri, 18 Nov 2016 03:59:27 -0500 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 In-Reply-To: <2D8B8AAF-2016-45BD-9D70-A532DDDB23D2@dilger.ca> References: <2D8B8AAF-2016-45BD-9D70-A532DDDB23D2@dilger.ca> <147938969703.13574.10295364502230379833.stgit@warthog.procyon.org.uk> <147938970382.13574.11581172952175034619.stgit@warthog.procyon.org.uk> <1479407964.4556.5.camel@redhat.com> To: Andreas Dilger Cc: dhowells@redhat.com, Jeff Layton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, drepper@gmail.com, linux-api@vger.kernel.org Subject: Re: [PATCH 1/4] statx: Add a system call to make enhanced file info available MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <25498.1479459547.1@warthog.procyon.org.uk> From: David Howells Date: Fri, 18 Nov 2016 08:59:24 +0000 Message-ID: <25517.1479459564@warthog.procyon.org.uk> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 18 Nov 2016 08:59:26 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1658 Lines: 43 Andreas Dilger wrote: > >> If neither AT_STATX_*_SYNC flag is set, the behaviour is the default for > >> stat() on that filesystem. > > > > We also need to specify here what happens if both bits are set. Should > > that be -EINVAL? > > If that is the case, then it doesn't make sense to have two contradictory > flags. Yes it does. There are actually *three* cases, not two. Maybe, rather than a pair of flags, I should stake out a 2-bit field with three possible values. > Pick a default behaviour (i.e. return what is known on the client), The default behaviour has to be what stat() does now for any particular filesystem. statx() is likely to get used to emulate stat() so that stat() can be made to return safe timestamps. If we make it so that statx() cannot do this, it's very likely that we'll see yet another stat() variant syscall being added. > and if this is 100% accurate (e.g. local filesystem or filesystem with > strong coherency) In a netfs, it was 100% accurate at the point the server started transmitting its reply. This may no longer be true - even with something like AFS that has change notifications. > then it can optionally set the SYNC flag in the returned > flags. So you suggest putting the SYNC flag(s) in the request mask rather than sharing the AT_* flag space? > If the application needs 100% accurate size info, then it can set the SYNC > flag in the request and the filesystem may need to do extra work to fetch > accurate data from the server. Note that one of the things that people asked for was a DONT_GO_TO_THE_SERVER_AT_ALL flag. I take it this is your suggested default? David