From patchwork Fri Oct 19 12:20:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10649203 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 3BCB713B0 for ; Fri, 19 Oct 2018 12:21:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B296283FF for ; Fri, 19 Oct 2018 12:21:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1EC7928922; Fri, 19 Oct 2018 12:21:04 +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 B406B283FF for ; Fri, 19 Oct 2018 12:21:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727509AbeJSU0y (ORCPT ); Fri, 19 Oct 2018 16:26:54 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:55797 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727387AbeJSU0x (ORCPT ); Fri, 19 Oct 2018 16:26:53 -0400 Received: by mail-wm1-f68.google.com with SMTP id 206-v6so3408960wmb.5 for ; Fri, 19 Oct 2018 05:21:00 -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:in-reply-to :references; bh=qE3Rs28MEBDxBAAHmciCMpu1FI8X4EuBPjRL/1BPcXM=; b=f+4PrlxRk4wKP3U9u2J4Z1hxND0/IFNGmGHDtx8e+fvBrgH/6y6Cg25xkfUAj/dadK Nn9/TST6biFEOLhdyUuYp04vhMpHmXFQsl0+FIricj0xMyPpXPZ5tQ/4Epgsbwe4YuQQ DkwmuFEdwMUiL7Uj1FNtBOjvZN2Z3bj+2fFZNlwXKQuyFUkvgnnamCzEYRioVDPvG1gf KMal+lF3nmASuF7q0/Z0t7idzMG41Pis5jf02BJVw5DLdAHs2+IOUDuHepWYS/WWG1qZ hZCD11ZkmN0JNEd2KLU99IlDn7NbEjT8Ks5urhQEtv2+lkzOXQuH3v3saATzhNWQBVoZ Txsw== X-Gm-Message-State: ABuFfojPsolO0KveHIQwmza8BdnYhtfuQyuPA0RQTs5u+0xwVH5Y8NTs /REL8jk5P7nCO9uu00jIG0PgsAAZgzw= X-Google-Smtp-Source: ACcGV61JyOlB7Yq+Dwrp0lv4vqfDXCTk8IG9UEfYUoQDYpYyzQwE5HBISNweTrOIuW7U7+JW+jMPJQ== X-Received: by 2002:a1c:1b84:: with SMTP id b126-v6mr4763334wmb.121.1539951659662; Fri, 19 Oct 2018 05:20:59 -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 s10-v6sm1858283wmf.15.2018.10.19.05.20.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Oct 2018 05:20:59 -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 , Trond Myklebust Subject: [PATCH v2 5/5] nfs: don't clear STATX_ATIME from result_mask Date: Fri, 19 Oct 2018 14:20:49 +0200 Message-Id: <20181019122049.27121-5-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20181019122049.27121-1-mszeredi@redhat.com> References: <20181019122049.27121-1-mszeredi@redhat.com> 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 As per statx(2) man page only clear out flags that are unsupported by the fs or have an unrepresentable value. Atime is supported by NFS as long as it's supported on the server. So the STATX_ATIME flag should not be cleared in the result_mask if the operation was requested on a MNT_NOATIME or MNT_NODIRATIME mount. This patch doesn't change the revalidation algorithm in any way, just the clearing of flags in stat->result_mask. Signed-off-by: Miklos Szeredi Fixes: 9ccee940bd5b ("Support statx() mask and query flags parameters") Cc: Trond Myklebust Reviewed-by: David Howells --- fs/nfs/inode.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index b65aee481d13..34bb3e591709 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -811,7 +811,7 @@ int nfs_getattr(const struct path *path, struct kstat *stat, if (!(request_mask & (STATX_MODE|STATX_NLINK|STATX_ATIME|STATX_CTIME| STATX_MTIME|STATX_UID|STATX_GID| STATX_SIZE|STATX_BLOCKS))) - goto out_no_revalidate; + goto out_no_update; /* Check whether the cached attributes are stale */ do_update |= force_sync || nfs_attribute_cache_expired(inode); @@ -833,9 +833,6 @@ int nfs_getattr(const struct path *path, struct kstat *stat, goto out; } else nfs_readdirplus_parent_cache_hit(path->dentry); -out_no_revalidate: - /* Only return attributes that were revalidated. */ - stat->result_mask &= request_mask; out_no_update: generic_fillattr(inode, stat); stat->ino = nfs_compat_user_ino64(NFS_FILEID(inode));