Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2104641imm; Thu, 18 Oct 2018 09:06:53 -0700 (PDT) X-Google-Smtp-Source: ACcGV62qv2/ijCBsrU03PJsW8+s3Rz5FgmyiG+vgROzbifAnc+/xddMdfnezrjYLBxoUC2ljzMzV X-Received: by 2002:a62:be1a:: with SMTP id l26-v6mr31767490pff.204.1539878813205; Thu, 18 Oct 2018 09:06:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539878813; cv=none; d=google.com; s=arc-20160816; b=s4bzwYwgacOCxesB9GZwVtrxbP2BokboAIDcOqC7NFtHWLlnPgS9gqkZXTpjMPGoYK XqoJyd3wPLpy45XhPqtBdufTOB/nSqcB/Id0Ww4ybXBufmaKGBoktU0nXh5aFTdvcwpC k6ENaVCyOq7Nm1eJyybIjdlVRFqV4/BThJmYvkOR9g+3F99ukw29n0arJx6hOGxa4yaI s6xRhUmoSpG6pNPR0RHl4VQa8o8J2pD58LEASq4JyfC/DJuRFc8j1Lp8w9GR7Hu7wlt6 +gB0JPw60szK9uVqq4ww8qIfIgPYMYVs4yurQ7BOO+bCIeuqhzcJ0+nCEaBxx41pKDFJ VfbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:content-id:mime-version :subject:cc:to:references:in-reply-to:from:organization; bh=S94E5qMK+M/K0asXfydtozx5kP7L+1tlFeyoYbocnpg=; b=I4hKG1hqxro8Z74sRwdCkoolNeWKYvT0m6MTS+wDBih0QF23b03HZCSLL3UcIcGE/4 wBObRC1OoKnN9ARFNCyBNJ4mrgneTbwkSdtkcQmo2v2Ce0kGELy/vJA443eNe4kK0KlM /UKzOJlNFe5RW4XDDwyECxH9DU9BmJouKHVKsu7zChBn6rKbODPrlv7adIcA5eMhnKxh cSA7mgzHiplCCKae5CEvRXKAHFqf9BqdoZyM+VjN6vpRc6V+NWVjD9C8qOq6e7Mz2HHJ eqyIV5xXZEA+k5lHAZRizSRC0C5TsftSBCQQ41OkDHNUUT5ttirpkdapKJTb8Fj0cNAP zemA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u1-v6si21592602pgq.1.2018.10.18.09.06.34; Thu, 18 Oct 2018 09:06:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728422AbeJSAGE (ORCPT + 99 others); Thu, 18 Oct 2018 20:06:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58556 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727274AbeJSAGE (ORCPT ); Thu, 18 Oct 2018 20:06:04 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6E1B08046C; Thu, 18 Oct 2018 16:04:25 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-250.rdu2.redhat.com [10.10.120.250]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3FADA2B5AB; Thu, 18 Oct 2018 16:04:24 +0000 (UTC) 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 From: David Howells In-Reply-To: References: To: Miklos Szeredi Cc: dhowells@redhat.com, Michael Kerrisk , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Linux API Subject: Re: statx(2) API and documentation MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4892.1539878663.1@warthog.procyon.org.uk> Date: Thu, 18 Oct 2018 17:04:23 +0100 Message-ID: <4893.1539878663@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 18 Oct 2018 16:04:25 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Miklos Szeredi wrote: > I'm trying to implement statx for fuse and ran into the following issues: > > - Need a STATX_ATTRIBUTES bit, so that userspace can explicitly ask > for stx_attribute; otherwise if querying has non-zero cost, then > filesystem cannot do it without regressing performance. Okay, though the way your patch implements it makes it superfluous. I presume you have further patches that will actually make use of it from the fuse side? > - STATX_ALL definition is unclear, can this change, or is it fixed? > If it's the former, than that's a backward compatibility nightmare. > If it's the latter, then what's the point? It's the set of supported attributes known by the headers, and such can only be added to over time. But yes, it's probably unnecessary. Asking fsinfo() will be a better way of doing things. > - STATX_ATIME is cleared from stx_mask on SB_RDONLY, Ummm... Where? It's cleared on IS_NOATIME() in generic_fillattr(). I made the assumption that IS_NOATIME() == false indicates that there isn't an atime to be had. > and on NFS it is also cleared on MNT_NOATIME, but not on MNT_RDONLY. We > need some sort of guideline in the documentation about what constitutes > "unsupported": does atime become unsupported because filesystem is remounted > r/o? If so, why isn't this case handled consistently in the VFS and > filesystems? STATX_ATIME should mean there is an actual atime from the "medium" in stx_atime, rather than something made up by the filesystem driver; it doesn't necessarily promise that this will be updated. There can still be an atime if the medium is read-only. atime is even more complicated with MNT_NOATIME or MNT_RDONLY because that doesn't stop the atime from actually being updated through another mountpoint on the same system. Note that stx_atime should always contain something that can be used directly to fill in st_atime if emulating stat() - even if STATX_ATIME is cleared. > - What about fields that are not cached when statx() is called with > AT_STATX_DONT_SYNC? E.g. stx_btime is supported by the filesystem, > but getting it requires a roundtrip to the server. Not necessarily. It's not cached in *struct inode*, but that doesn't mean that the filesystem can't cache it elsewhere. > Requesting STATX_BTIME in the mask and adding AT_STATX_DONT_SYNC to the > flags means the filesystem has to decide which it will honor. My feeling is > that it should honor AT_STATX_DONT_SYNC and clear STATX_BTIME in stx_mask. > Documentation has no word about this case. From the manpage: AT_STATX_DONT_SYNC Don't synchronize anything, but rather just take whatever the system has cached if possible. ... Note the "if possible". If it's not possible, you still need to go get it if they explicitly asked for it. David