Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp2363624rwa; Mon, 22 Aug 2022 06:39:43 -0700 (PDT) X-Google-Smtp-Source: AA6agR7a6pno4c/jdiwNY3Syteexbr9Kyae6IVxdj7bu6ZWxFFQRpZ51f92Rg5hIPm4dyExb/UMu X-Received: by 2002:a17:90b:3889:b0:1f5:88cd:350d with SMTP id mu9-20020a17090b388900b001f588cd350dmr28882083pjb.9.1661175583651; Mon, 22 Aug 2022 06:39:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661175583; cv=none; d=google.com; s=arc-20160816; b=xS6RLv0jw6oVvC2I9RVgDLWpGS/vYgTMcF4NmiUuFJG94svaQadGjy4f5WGxpSvkXv MvNsTiSq31dOd1HxGT5mS4Qunaqomompi1xi4dMKyLgYeVio9BBJsLufj7V7mT/9k/vu N0YqxoPplA0P5VY/B+gYSCw4U0cjkkIA0j9Nv2QnsIZdSeD8GOstrJYUhHmbmBS+3dGv Slkc1/uaTfxESyeOWPufVClnadpQtw6p5yTL9x+r9yerY+WpLxSy+9iVdQbe5gLPvtBH z0XYz7WPY90S1pfU/yOHgjqychy2VsAKKKMDFiaMrM2WMsaWSGAZ+51BngjglLpqnMD/ qWew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=z67gaaDadxIfOgqW+NhRLNCUWp412T4BekfFckQeVHQ=; b=H7jOQuxMEDAO9kON6uzlNO4cHQK8+vVZyC/WCQ7xXVkWT/5lv9Y1Nl64HErAob8Bch Nw32m8ylIFD4nhwBmQyEdl3ip7+CGutaDIePxqGX25fiCq3pZP5hykVvUJ/cdE9Sqw42 KmJChPNhlzZ3Kd6ukZNCAim37nSRF12a/kUCGEDHTyGfD4Z+RgHMn2i8lLUnkZ18r+1r m2FLr6XPFrnKMqMulrDBhb4fNBt/C9ZBYEye3phFRLSc+31EHkA/vAzgjaMLP5c9sYUU FcWsmneA1Ns2lfV0RBu0ywOIRS2K3jz5BfJir+A0R3KhG8sKUC0xgUjxgOMB51x8ia0U XAjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y69UKGM3; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h24-20020a63df58000000b0041a11845a19si10922678pgj.703.2022.08.22.06.39.15; Mon, 22 Aug 2022 06:39:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y69UKGM3; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234878AbiHVNdR (ORCPT + 99 others); Mon, 22 Aug 2022 09:33:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234147AbiHVNdQ (ORCPT ); Mon, 22 Aug 2022 09:33:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D223A1A3; Mon, 22 Aug 2022 06:33:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 70D9661190; Mon, 22 Aug 2022 13:33:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EFA37C433C1; Mon, 22 Aug 2022 13:33:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661175191; bh=XXoXVTwv4p663PKv29Ug+s5+Q9mMsY4SeFyX9qyLO3k=; h=From:To:Cc:Subject:Date:From; b=Y69UKGM3eqjCqXyVWILpXzm3HHnUVFNxp9O49y6Uz020SjbEOnQ4/P8B2pM+W1hs2 /GM9JeR3zf2RcUC5Ny249iiba1/ICi2MjjuTVaRHGVkExESDkP9gH6T/cDI8v8d/Fk izGGAvfChPCWKEU0EQmHFmplhUevqkTRzzkd/XuCZCmhGfVE5bPj/DY4w9ND61FK5D ShR8eN1uSEWbYWFZ81iMXtdFMCZD+rCa6dpozxQe3NGEyYf/9yo/X3tTvR6JPD6Lmu cILu31VAIMpU6t7r4/dfPznXwM5uVfruXtQUYl3T0pankxf7T2VMYHUHKfiBA1i/WH 1FFgDiUOli0xA== From: Jeff Layton To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org, linux-nfs@vger.kernel.org, linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org, NeilBrown , Trond Myklebust , Dave Chinner Subject: [PATCH] iversion: update comments with info about atime updates Date: Mon, 22 Aug 2022 09:33:09 -0400 Message-Id: <20220822133309.86005-1-jlayton@kernel.org> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Add an explicit paragraph codifying that atime updates due to reads should not be counted against the i_version counter. None of the existing subsystems that use the i_version want those counted, and there is an easy workaround for those that do. Cc: NeilBrown Cc: Trond Myklebust Cc: Dave Chinner Link: https://lore.kernel.org/linux-xfs/166086932784.5425.17134712694961326033@noble.neil.brown.name/#t Signed-off-by: Jeff Layton --- include/linux/iversion.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/linux/iversion.h b/include/linux/iversion.h index 3bfebde5a1a6..da6cc1cc520a 100644 --- a/include/linux/iversion.h +++ b/include/linux/iversion.h @@ -9,8 +9,8 @@ * --------------------------- * The change attribute (i_version) is mandated by NFSv4 and is mostly for * knfsd, but is also used for other purposes (e.g. IMA). The i_version must - * appear different to observers if there was a change to the inode's data or - * metadata since it was last queried. + * appear different to observers if there was an explicit change to the inode's + * data or metadata since it was last queried. * * Observers see the i_version as a 64-bit number that never decreases. If it * remains the same since it was last checked, then nothing has changed in the @@ -18,6 +18,12 @@ * anything about the nature or magnitude of the changes from the value, only * that the inode has changed in some fashion. * + * Note that atime updates due to reads or similar activity do _not_ represent + * an explicit change to the inode. If the only change is to the atime and it + * wasn't set via utimes() or a similar mechanism, then i_version should not be + * incremented. If an observer cares about atime updates, it should plan to + * fetch and store them in conjunction with the i_version. + * * Not all filesystems properly implement the i_version counter. Subsystems that * want to use i_version field on an inode should first check whether the * filesystem sets the SB_I_VERSION flag (usually via the IS_I_VERSION macro). -- 2.37.2