Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3448442imm; Fri, 19 Oct 2018 10:43:09 -0700 (PDT) X-Google-Smtp-Source: ACcGV62BdKREtdOqkwOp9TW7DxqKRefKP10m/URBoo8PTDmpDDAKJVIxh2Bw66PduWQHNb9fZrrz X-Received: by 2002:a17:902:6689:: with SMTP id e9-v6mr11064163plk.128.1539970989427; Fri, 19 Oct 2018 10:43:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539970989; cv=none; d=google.com; s=arc-20160816; b=s9V/nsFkkRDcjNMQdjZaU1yT58DE7K4oh3CuDc3lTR5WKJstu36QcR9430UGIjnqpb TLbe9uMxbhJTEsZEuE8j75Qd5qGxCEN9/9ilDYp3DBONcUo+eZofu7idwmbHVAnbMT5R qUmzOOqjMsyawDsDVjenwVeeVmu8INiEvjToxbG74fyM71322QV9Vqgnn3Fj4EKe2tWe W3ndQRNdL1e/Lh3Wls18Gj2UezarhQuunyg5AE5Pp2YE2A7JnD1FecDpQT9r6iELN1n/ eEDeyd0UkJL0Or8hx5waz6yWrjZjv1P9Qx5KBB84akO1Y7h3mGP12qpYf0KpnuJfy/6Y M9/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=8JSFsW4o40O8KZj0mDu5Ev8RmkQ3Fw9lxAJE8kguQs4=; b=LGsmFyamDRAZLM9J4/ifNG+fpOvNG2FjhMwelN7Nz3QQK36EH8eTVdNJqIWJY+OBfw NwjpMgCVxDLADs9Ii3rz8sFzRrAb7BUKie8QdLUKwD57WREmF5/5vSg9vP4DefTRA1ZQ bwQ7gdwutLI5lZezCbIrLueXh8VKuD8kqa3j2qIlPZh4BBtPRwrkwnL27vccU5S1ExTf RmS4aD79yFzOzpPvGNOm+C/RwPE2eo380S6H2cLTDEoHRncMFS4hFrOknYjkcUe6tdZq rH9dpDg0NH0rWNNDOudKRQP+y55H400NzNt3q7EMtmXXVSg5LmTHCri/JTT6FGiI707D oL3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=fHRYTKAJ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f6-v6si968158plt.346.2018.10.19.10.42.52; Fri, 19 Oct 2018 10:43:09 -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; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=fHRYTKAJ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727794AbeJTBtd (ORCPT + 99 others); Fri, 19 Oct 2018 21:49:33 -0400 Received: from mail-it1-f194.google.com ([209.85.166.194]:53733 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727549AbeJTBtc (ORCPT ); Fri, 19 Oct 2018 21:49:32 -0400 Received: by mail-it1-f194.google.com with SMTP id q70-v6so5209424itb.3 for ; Fri, 19 Oct 2018 10:42:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=8JSFsW4o40O8KZj0mDu5Ev8RmkQ3Fw9lxAJE8kguQs4=; b=fHRYTKAJyuU6K1PNDU4LDW/ff/BeP81AOrOGSFuu4DUcjaPGdOYt5P4SMw9X/rbe/1 LzUw1YNFvSoaOlKrc20Wn4HLlx0v5239yBPD0O/zxK/2zlLZk2FPGxQJpdtiTIiqqG1w UiYvFG9atqqOrGif/BWp5SmtI/ew0M1YPMdXM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=8JSFsW4o40O8KZj0mDu5Ev8RmkQ3Fw9lxAJE8kguQs4=; b=pdtnwiVNIUPlaB6GZkArdqOghcuG8MRIYuxuFauY9YTxAwDPVIcQbP5ybbtAAV+LO3 7G/HHKTQB4S/OZ9kXHvThFhfXDFA2QRMZeExXuNLOYMbhAOEBFQ0jWwX138VGEZjW2nI bJeCEso+gYnfzC1EwFBPPqRgqLvZ6UTPiVZAnrD0iKk+OHMLJGesufn2zOb0t2xsDOu1 Ka7VHdeUGn8PVGTYoUjAa55vRgW0490iimenlgM5eyA+BTdZT7MhzJRnsgONM4aZgrcx p+cMG/Q2JaVSzNs/II75feQWYX4s8eF8CdmNK6MAZ9njEgGY/P25aa0G7ERDAw8DXnTf AmfQ== X-Gm-Message-State: ABuFfojuLEyWdU7a3ib7fLDHjKAMda9wOMNzYNEQLhdeCWcFOgZU4BZk ZNMvCdS+3TBedyCIDavQWYCjpnovCLsaFf3g6RWpUg== X-Received: by 2002:a24:75d6:: with SMTP id y205-v6mr3972264itc.1.1539970947827; Fri, 19 Oct 2018 10:42:27 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:bf41:0:0:0:0:0 with HTTP; Fri, 19 Oct 2018 10:42:27 -0700 (PDT) X-Originating-IP: [212.96.48.140] In-Reply-To: <18142.1539964788@warthog.procyon.org.uk> References: <20181019143932.6697-1-mszeredi@redhat.com> <18142.1539964788@warthog.procyon.org.uk> From: Miklos Szeredi Date: Fri, 19 Oct 2018 19:42:27 +0200 Message-ID: Subject: Re: [PATCH v2 6/5] statx: add STATX_RESULT_MASK flag To: David Howells Cc: Miklos Szeredi , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Linux API , Michael Kerrisk , Andreas Dilger , Florian Weimer , Amir Goldstein Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 19, 2018 at 5:59 PM, David Howells wrote: > Miklos Szeredi wrote: > >> FUSE needs this, because it uses legacy inode initialization, that doesn't >> return a result_mask, so needs a refresh when caller asks for it with >> statx(). > > Can't you just make it up in fuse? Presumably, fuse doesn't support any of > the non-basic statx fields either? This is very much about the basic statx fields. I.e. what does result_mask == STATX_BASIC_STATS means? a) this is a legacy stat() implementation that doesn't fill in the result_mask properly b) this is an up-todate stat() implementation that does fill the result_mask properly and all fields are valid There's no way to tell which one it is, and no way to request that filesystem try b) even if it's more costly. >> It might make sense later to promote this to a proper statx mask flag and >> return it in stx_mask to userspace. > > That sounds kind of recursive - a bit in stx_mask would be saying whether or > not stx_mask can be used. Yes. See above. >> +#define STATX_RESULT_MASK STATX__RESERVED > > Please don't use that bit. Using it internally is perfectly harmless. If we'll need to extend statx in the future and make use of this flag externally, then we can easily move the internal flag somewhere else (e.g. extend request_mask to 64bit, which we'll probably need to do anyway in that case). Thanks, Miklos