Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3453021imm; Fri, 19 Oct 2018 10:48:24 -0700 (PDT) X-Google-Smtp-Source: ACcGV61hv2Hdtz7yNg1KBsWwysNpUO5LSV8fxsyZy5fbHHWPtZ2QD7QjuiXq+W8np5qZH7RO77OA X-Received: by 2002:a63:1711:: with SMTP id x17-v6mr32691205pgl.364.1539971304087; Fri, 19 Oct 2018 10:48:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539971304; cv=none; d=google.com; s=arc-20160816; b=KRtz0CMcGGmkHYglP9xyKGfRT8mbBGyyWHWPx8KTOmeBj77cI8OVhNnC/nAfGEaTzE WbSk1AEV5cOF+L/6JdFJ9N+ZmKv10cxuOap6fUg4ZIa22W3AVfhI6cCtmXXPvMmH4vPC UBZUqN3uboTV65F8gE+/75Vum5gFLTNF0Slv16DKHYktgKnQYGhGkl7vtmKd8YcerZL1 D0jdUAymaf524nwuTHwD+8XANKiO+sjX5/zh3cFXY3jBcFjYFGxC4zQ4x3TdVRLGAKTW 7LGIT0XlXvFiL72L1F4kJlMH53st3ad2h4F4j5NDWB944x3PWJXMorA+4jdFWWBkdAZH Mm4A== 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=IO1973WRgfLLNX1toZfekCZsGx6Fuh6uNEskmFyMtSY=; b=X4/keATT9QfqB1vv8+YyFSBRnqFtq8ccHClKlvaUUMUKM+MqVcV1aEKPiUDgpzqYL7 qBGz5IgxQtFb9k+jXnsp6Bcb7ESvyrypxOcRf+xmNyYolMJ33v6CzJpptL6U4iRGXxXv JjPJpZ/Zx8r+8uoN8NtUfSGu0RFG1KIVmrXRHFKvErFg6qpmV6NmjJrZo20M3fflJb3o Ow4sAVwNRNPInaPcSQFxfX7WOD+I+GuAdNjZkGAAjrK19glFd8n2d/wwS7igEng928bs ZDS1w5q+tlL1ii3tLfSWD5wCZpGpG2Gtuq6XKtbLxBfbj0GK5vB92+stfvqDEaspaDOI pQ+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=jG524Guf; 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 j13-v6si23900949pfn.288.2018.10.19.10.48.08; Fri, 19 Oct 2018 10:48:24 -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=jG524Guf; 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 S1728054AbeJTBxX (ORCPT + 99 others); Fri, 19 Oct 2018 21:53:23 -0400 Received: from mail-it1-f194.google.com ([209.85.166.194]:50981 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727817AbeJTBxX (ORCPT ); Fri, 19 Oct 2018 21:53:23 -0400 Received: by mail-it1-f194.google.com with SMTP id k206-v6so5244919ite.0 for ; Fri, 19 Oct 2018 10:46:17 -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=IO1973WRgfLLNX1toZfekCZsGx6Fuh6uNEskmFyMtSY=; b=jG524GuflIHnWUI/34mATY28ajyjM9EOJDzsGi73wuT5GF0r14M8/XNNMjryITF0QZ nYjWHPPTD1ehXUfioEh5tFuj62F+rqvTZ6n3D/h1jwQZ3o14z1xzVLLPGThfISuSgBDh +LeERrn8RV7L3MzRCsJTL5vnqmTHCs3F+TL98= 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=IO1973WRgfLLNX1toZfekCZsGx6Fuh6uNEskmFyMtSY=; b=cWdulKC5os+ik65/vZBfWiL82Zvy9lfUkcpIg2NC1nNvAYXpSPuXLjicHFl8mYNoSW TS3vUVKZpRK40fgDegoW9S1mlA1/hezt0JoGGs9Z1749ujBPaFeJD9g9jLtsQCiu7dG5 EqHadz8NjWE16ACq4uEnka0pwCflVWxJS/0cDlMHggPsNUS3cyfa1gUfoSlF9thU+8A1 Ap6mf5/uPrYhwoQo3NXO4Eubfb7mymHlmV+E9kFDtlTMjCWQKocW4N/s6OL3NJMi6fY4 6BxUepIewRMi9Z8zwEstAwLcjdh8AzJtOEszPmbtq+cT8KT7GYmvQV1fMDbqDWKvQgW0 xPmg== X-Gm-Message-State: ABuFfoh59SfeGJaHOApCEY+tLMlXsPv+rHu3fbxJEEoad/mijAQlf3dM GCyIJgd63XkO2HL3EgU3cdB+HDgEpWjGR36jMCV5hw== X-Received: by 2002:a24:75d6:: with SMTP id y205-v6mr3981082itc.1.1539971177009; Fri, 19 Oct 2018 10:46:17 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:bf41:0:0:0:0:0 with HTTP; Fri, 19 Oct 2018 10:46:16 -0700 (PDT) X-Originating-IP: [212.96.48.140] In-Reply-To: <2ca365ec330cf918188e8c47b26e741073382d9d.camel@primarydata.com> References: <20181019122049.27121-1-mszeredi@redhat.com> <20181019122049.27121-5-mszeredi@redhat.com> <2ca365ec330cf918188e8c47b26e741073382d9d.camel@primarydata.com> From: Miklos Szeredi Date: Fri, 19 Oct 2018 19:46:16 +0200 Message-ID: Subject: Re: [PATCH v2 5/5] nfs: don't clear STATX_ATIME from result_mask To: Trond Myklebust Cc: "mszeredi@redhat.com" , "linux-fsdevel@vger.kernel.org" , "amir73il@gmail.com" , "linux-kernel@vger.kernel.org" , "adilger@dilger.ca" , "mtk.manpages@gmail.com" , "fw@deneb.enyo.de" , "linux-api@vger.kernel.org" , "dhowells@redhat.com" 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:52 PM, Trond Myklebust wrote: > On Fri, 2018-10-19 at 14:20 +0200, Miklos Szeredi wrote: >> 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)); > > NACK. > > When we don't revalidate the attribute, then the content of the field > contains junk values. The above code is very intentional. How is it then that only STATX_ATIME is cleared and not the other fields? Note: junk != stale. The statx definition doesn't talk about the fields being up-to-date, except for AT_STATX_FORCE_SYNC, so stale attributes are okay, and do not warrant clearing the result_mask. Thanks, Miklos