Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3108085imm; Fri, 19 Oct 2018 05:21:51 -0700 (PDT) X-Google-Smtp-Source: ACcGV61j4UQ5C0Q39OMZw6fTSf0i5RYhUTDfK6ScwrJbYfLt0pKpg284F1nXoQEpaCxBBch5Klbh X-Received: by 2002:a63:c908:: with SMTP id o8-v6mr916198pgg.261.1539951711484; Fri, 19 Oct 2018 05:21:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539951711; cv=none; d=google.com; s=arc-20160816; b=DryipfNcrTGPHKB1LoEw6mmGcr1AN0WNrM6o1d42sKBcNO35WSdX7zs66VTGYch1lv mZ6sKbzeIlDxrJBgDbvDMuMhS1DLOU2hKrJiY8eimGS8OIjrCsQgViN0VHB2exf+eAUV WjcbAwEMzo0QLN62QKWBg1OzopVsOzBCB+N4vLZ4mL8uSHxBG0qTwU+KJOrDYX8P7VJW yazE6D4r9IoYPMUmLRLvKcsJG5R1+gfIEC2YylOHzl/k0KvvMZea/BzuvM32Ex6FtLwq v0N1vvmG/MGc2MVmhVsc8SLaFr+HdA3SJJkOOXkP8z55/7hLH+AaSlSqcKVhl3iBrA19 iPxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=qE3Rs28MEBDxBAAHmciCMpu1FI8X4EuBPjRL/1BPcXM=; b=C/0+tOTb+18Yhu1hDhsqI+eQBR/2+/FYjlAhfSrum+Q0XxYPX8DpCKc8ocYYGm4xv+ nTrQrJzKURWhNjO42rhX+R02ylMcjCgH7Sb/cgMMrLjtBAR0HPNYQNAVQblnsm2DCi5Q yFSvZt7PmF0kgq3AXVTJs6znrWK/APHlAU+qRfTImAFK+UP3mJmrxbLeciZ3SOro/jxE rOPcq9HUuHDtxsvEAyxkTjTX9wmhY0biLG/bQ/DweBPpsImIo2tmnFGBGGqC4Qof9UH3 W7ZDXu6Xn9uYpJqf4c6ZocPUDt7KZa8MPJ3zTV23fzJnUzx/u1qln1+wil2PdJFQJpl9 90Lw== 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 m17-v6si25004239pgj.155.2018.10.19.05.21.35; Fri, 19 Oct 2018 05:21:51 -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 S1727498AbeJSU0x (ORCPT + 99 others); Fri, 19 Oct 2018 16:26:53 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:53973 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727333AbeJSU0w (ORCPT ); Fri, 19 Oct 2018 16:26:52 -0400 Received: by mail-wm1-f65.google.com with SMTP id y11-v6so3431301wma.3 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=FpMFHVhQKrxszzRH9AtMdnwWxkcAkG3UdiKj0/fZABl2YH0qFBz9FdZGpNolaW4kCJ 9vHLmkruJ7M+CW8D8BqwZGrhfP6uDFLVDfKDb/RSGWjiNtf8g4kQzuU1j/qm6i5g2wZL 8/Ggq6EIXXq6iaI88MQSGVQSZYAUgRn0mNv+btX/aTvGQlN7CqvaFaZeB8RGmCFhF8kM Scb0SYUdldodJdFPDafJvCFZtr6iEmQhX/RTUqQI6nSW52V2FuRrbRfFtvB5EoCTPxfd T/gCiR3Bu3Tncb3bmS+ciycCu6Gq6kKoYsMuLlelJ+Akc3zXetb9uqEw/a4e7ixNX5Tz KDYw== X-Gm-Message-State: ABuFfohX2xVLImDAfoU8BqchVEdQGP8Cf8BPch9RACyrvepYiM9FFqMx LQyRGg5NFoQPN2v09w6madItUw== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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)); -- 2.14.3