From patchwork Fri Oct 19 14:39:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10649567 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 40E691750 for ; Fri, 19 Oct 2018 14:39:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FE3928B7D for ; Fri, 19 Oct 2018 14:39:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23F8728B87; Fri, 19 Oct 2018 14:39:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA07928B7D for ; Fri, 19 Oct 2018 14:39:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727636AbeJSWqE (ORCPT ); Fri, 19 Oct 2018 18:46:04 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:34950 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727243AbeJSWqE (ORCPT ); Fri, 19 Oct 2018 18:46:04 -0400 Received: by mail-wm1-f67.google.com with SMTP id o17-v6so3203401wmh.0 for ; Fri, 19 Oct 2018 07:39:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=HU0R7KVf1xoioTYJzHVw3MUGocV2f9Bu+ekPmQEz7Vg=; b=pB8fwSRBc//ag0SVudUhQBPku7ZsTlsiSGO7X/mULGZQsllbiLT9x6KOAuyoj7Sa7F XrVMj4byPtADqboP/OnfimHo4AIZoAFySLG12hUyXDDx/YXsUVRQZcPFJ28zaegk7bBn AKBEGciTf9Qi0p0PT0B8Ewlnb+ibIT4OWHd7DnXAbg8d7iGdYAG7WzZobJmAWp/11pMt ncjOZYa0yinR4sRYo+M/Tynh+RFwp2G4/I77UzyIonAcSz7TACprswKlHR5lJnizbLFa 9mR3QfaYl1Uv6DURvMWyOv/PGyztd/xNRrpHdNAZ0KTVDhVY9idN6bXdhbzA80r6MuL4 FdOg== X-Gm-Message-State: ABuFfogRo5NW1L27mBvICMtmfiAg4mEdu0yPrIoZUsV+bHX/IKaMjHW9 8vLTTPqKbPkrXJihzzrGvzGCDd5AN8A= X-Google-Smtp-Source: ACcGV63citd/TL8wF2EqX8hL279O3gAwa3XMG0gQj31gHy3coq89QtHAnwxIj3FVLH+bWK4xYFz3/w== X-Received: by 2002:a1c:2bc3:: with SMTP id r186-v6mr5412645wmr.51.1539959978481; Fri, 19 Oct 2018 07:39:38 -0700 (PDT) Received: from veci.piliscsaba.redhat.com (catv-212-96-48-140.catv.broadband.hu. [212.96.48.140]) by smtp.gmail.com with ESMTPSA id x139-v6sm7251879wme.3.2018.10.19.07.39.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Oct 2018 07:39:37 -0700 (PDT) From: Miklos Szeredi To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, David Howells , Michael Kerrisk , Andreas Dilger , Florian Weimer , Amir Goldstein Subject: [PATCH v2 6/5] statx: add STATX_RESULT_MASK flag Date: Fri, 19 Oct 2018 16:39:32 +0200 Message-Id: <20181019143932.6697-1-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This request_mask flag indicates that the caller is interested in the result_mask. At the moment all ->getattr() callers discard the result mask except sys_statx(). 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(). It might make sense later to promote this to a proper statx mask flag and return it in stx_mask to userspace. This needs some more work to make sure only filesystems set this flag where the result_mask is valid (e.g. NFS wouldn't be able to set it, since it doesn't query the server about supported fields). Signed-off-by: Miklos Szeredi --- fs/stat.c | 1 + include/linux/stat.h | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/fs/stat.c b/fs/stat.c index b46583df70d4..0b71e5bdbc6b 100644 --- a/fs/stat.c +++ b/fs/stat.c @@ -576,6 +576,7 @@ SYSCALL_DEFINE5(statx, if ((flags & AT_STATX_SYNC_TYPE) == AT_STATX_SYNC_TYPE) return -EINVAL; + mask |= STATX_RESULT_MASK; error = vfs_statx(dfd, filename, flags, &stat, mask); if (error) return error; diff --git a/include/linux/stat.h b/include/linux/stat.h index 765573dc17d6..65448b1163d3 100644 --- a/include/linux/stat.h +++ b/include/linux/stat.h @@ -21,6 +21,12 @@ #define KSTAT_QUERY_FLAGS (AT_STATX_SYNC_TYPE) +/* + * This is an internal mask value, meaning: caller is interested in + * .result_mask, i.e. it's sys_statx(). + */ +#define STATX_RESULT_MASK STATX__RESERVED + struct kstat { u32 result_mask; /* What fields the user got */ umode_t mode;