Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3618348imm; Fri, 19 Oct 2018 13:50:52 -0700 (PDT) X-Google-Smtp-Source: ACcGV62Zt1gCtYxq80uZkAEs11b0iquyzU88CLcFx7uYuOvAqDen8WUAEsSuD+e4UlwQM7Qujz59 X-Received: by 2002:a63:9712:: with SMTP id n18-v6mr34559189pge.182.1539982252711; Fri, 19 Oct 2018 13:50:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539982252; cv=none; d=google.com; s=arc-20160816; b=eLGJii+bP1ul+oYlRSRcJU/pEIOmcHr9kLNcm2EnSE08iS0OX3ML9xGDJOlpjZwRaA KAxV0QqXUis8Lob9m96tTp/MFH6h7AOjf54OsnnanjTNOPqFWSUHUPl4ry3XUBhhQ0DR vdI3OJAomEp/2zWaboNMSkzK0NOp/+ezdg0evOiWftPiJwRKIN+YiBL0LW4JxYZ/xSAV p/sRljuYpvJtYjla8TpU+rvlL4iqfv0A5jvmZHzgMe2lbFcLCdMmTJ6umHxm92CrPRVk 82Ks669g2+RB/0v9HeKQDrv1iPI08LEmEqGrdzqHNifBRVwhaHXM4wGlzlVGCf6yc8LP GJiw== 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=lO+UJg6EiMQ0ZYPWxKmGumVP9aJi/YF7ZASwMKlOjX4=; b=KX0ccxw7DGFMW6Jz3oQHxBAWFe284uf30wN0p/McIEOkrFBPyDCqD7s8g5bNRhEe6Q lIPsdwKjHszp1C0krotOneIBuvr6MrwjfefX0jUdFloDLxyExTFpsncP7MvpI50/Nv74 ZeI2ApU6i9RLWYcXcPmMn2NQv/+Vm3NfXiTRaiB1w6BjdtbsEktt1icrQ0CDOxZcuXu0 4BwIen8rw4GIdlpcW4qQWhx6ggLE6sqSVSUSDMrnSaH295mYnWwVcsJuqTWAMG2QjTeN IameexULO1xSTSqJ5YEPCkwyCj/PBdu3FWwj4ayfDArcL46jIdz8P7pWgWmXqV5D6Pgt RMbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=GRqhRnvD; 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 b2-v6si22659291pla.189.2018.10.19.13.50.37; Fri, 19 Oct 2018 13:50:52 -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=GRqhRnvD; 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 S1727246AbeJTE4T (ORCPT + 99 others); Sat, 20 Oct 2018 00:56:19 -0400 Received: from mail-it1-f193.google.com ([209.85.166.193]:50711 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727020AbeJTE4T (ORCPT ); Sat, 20 Oct 2018 00:56:19 -0400 Received: by mail-it1-f193.google.com with SMTP id k206-v6so5803317ite.0 for ; Fri, 19 Oct 2018 13:48:36 -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=lO+UJg6EiMQ0ZYPWxKmGumVP9aJi/YF7ZASwMKlOjX4=; b=GRqhRnvDbhBTqdmXFqtX3U+Vz22An61fBRKFR0zUAZVZSKW4b2xUT5fMm75lCOtqTe afmLETa3Eqs7W/9rypm6t4T02Eio47eVdd6ORSqHlnWdjbfxAD9F0kNPwCxJul8z71Gp 9nGtMYIFVSJ54pNmKwKAzwpnA7JWLttwg03pc= 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=lO+UJg6EiMQ0ZYPWxKmGumVP9aJi/YF7ZASwMKlOjX4=; b=M9lqjVLei5XyM3hRj6T3A/65WD5XHIlQdgVvRiyHiEoJ8dt8ViKaqw8y9VosYrAnW2 07uDN85Nd9sWDN3YaBcLYv/wt4lKAWs7/7qfwCjHyPm41Dy6D1qKLT7xw+onoFrTKzzP jT2Hbu4dUxfDV9pi906pMw5HaE7EUhiC71z7AVicFmbMBWTCXL0oetG+CiY0WYRt/2sI CWcoEJO95k/h6seqnEQ/e5ixCaiKNNjqIxWMRKyBkooFxGrF3rVPKt3hgwJlcg3kUqZW wq2COJwIIiJDFDTZVKtw2d6hpbsu3BDIUzfLR5yg7j2E4vJt4zbPd5ejDeqHLROlICMl 5svw== X-Gm-Message-State: ABuFfohtEQdjqh4HVtRg9w2t97bHLUkogDkyN7avmmKoMHKDnzWU/pIN MFsl6+lHJIkmJgeZRMfL12k+FDFZYgCf5IbyYwzT3w== X-Received: by 2002:a02:1818:: with SMTP id k24-v6mr27104482jad.77.1539982116337; Fri, 19 Oct 2018 13:48:36 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:bf41:0:0:0:0:0 with HTTP; Fri, 19 Oct 2018 13:48:35 -0700 (PDT) X-Originating-IP: [212.96.48.140] In-Reply-To: <05184f29b5778563519174769c675c5f6c5b2dd3.camel@hammerspace.com> References: <20181019122049.27121-1-mszeredi@redhat.com> <20181019122049.27121-5-mszeredi@redhat.com> <2ca365ec330cf918188e8c47b26e741073382d9d.camel@primarydata.com> <05184f29b5778563519174769c675c5f6c5b2dd3.camel@hammerspace.com> From: Miklos Szeredi Date: Fri, 19 Oct 2018 22:48:35 +0200 Message-ID: Subject: Re: [PATCH v2 5/5] nfs: don't clear STATX_ATIME from result_mask To: Trond Myklebust Cc: "linux-kernel@vger.kernel.org" , "amir73il@gmail.com" , "mszeredi@redhat.com" , "linux-api@vger.kernel.org" , "adilger@dilger.ca" , "dhowells@redhat.com" , "fw@deneb.enyo.de" , "mtk.manpages@gmail.com" , "linux-fsdevel@vger.kernel.org" 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 8:14 PM, Trond Myklebust wrote: > On Fri, 2018-10-19 at 19:46 +0200, Miklos Szeredi wrote: >> How is it then that only STATX_ATIME is cleared and not the other >> fields? > > It isn't just the atime. We can also fail to revalidate the ctime and > mtime if they are not being requested by the user. > >> >> 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. >> > > I disagree. stale == junk here, because the default of > AT_STATX_SYNC_AS_STAT is described by the manpage as "Do whatever > stat(2) does." which this is not. Ah, you are talking about this: /* Is the user requesting attributes that might need revalidation? */ if (!(request_mask & (STATX_MODE|STATX_NLINK|STATX_ATIME|STATX_CTIME| STATX_MTIME|STATX_UID|STATX_GID| STATX_SIZE|STATX_BLOCKS))) goto out_no_update; Well, if this is triggered for statx(..., STATX_ATIME, AT_STATX_SYNC_AS_STAT) and MNT_NOATIME, then yes, result will be junk. Which means that the code is wrong, it shouldn't do that. Otherwise (if something other than STATX_ATIME or STATX_INO or STATX_TYPE is given as well) it *will* do the same thing as what stat(2) does, so in that case STATX_ATIME should not be cleared (yet it is cleared). I can do a patch, but not tonight... Thanks, Miklos Thanks, Miklos