Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3489792rwb; Fri, 30 Sep 2022 04:29:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5zYSRIyGQnAtyYOvU8Ri7SIaocsi3qtyHNLf0AxOwnhYdgcpSOj5dSe3LJvWF97e3R3q6B X-Received: by 2002:a63:4e16:0:b0:43f:3554:ff9c with SMTP id c22-20020a634e16000000b0043f3554ff9cmr7277029pgb.578.1664537387793; Fri, 30 Sep 2022 04:29:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664537387; cv=none; d=google.com; s=arc-20160816; b=UO4YmrkPijYQiJ3gjeLVQ5nSeSMGXjoYRmoOeox/Yq8SJIIc+nT9FcNXdbomM/3iGy 4KZNi78Ak3oKbkVKPQF5akaUIuUbEnYmcrX3h4QfTFGfc0EUdOBW4fF5QyX/VnPGdhYH uzOlQzRSiOSwRbv3qWhQmSCPUO+2EubSLIg9Jrr2OwKEhn4COOK6IOap91bYBt+wmTsD Iel5oDWO42Y/61KW8D46IMhcJq1n+2nVMcaZAcqrNcNyhUKGFeeWctBfbGa9O/qA2P35 oV3maNeX60cSDZDnoB7Mq6nsyqLE80zf9lqT8EcS0Mg21l/d2/KelNI/afaSfuCa0+ci UEJQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pRAWbpt8rb1RO/Gtch1qeP6t67Jd9kaRDp0kh9lLSDs=; b=m9FRC768/tMEX/JLVLY0BCWL+OtaltIYIgI5n7WXX65OFhlMGFF84Ly2qH8kMpY8RZ 6qSZQxmCfDGHuRuOF00Apji8EIGFuy/vJO3NtE6stvcqf+XXRnK4xFptmOI7iBcyUjhM vsv/TrZBp4hcjAGOr8/3bsxS14UZgXHBvf8t3nYcXVR+vl6L2/lzH+bpnLpoGjOOAW+h 46lIdPjaOGqEYUoyk94jXY7oGqW1v4opEiPqjE9KYPghu6hN540gjfFehYfPqMYLDe8D M4Af2hh32Czez+8ksL91GKn9RBjHqWtVLnELAmFzGvvkKjSbzKSLCf8CizCH6w+XdNHn Ef6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=C25sKiNg; 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 u18-20020a056a00125200b00557863a7d1csi2440861pfi.110.2022.09.30.04.29.23; Fri, 30 Sep 2022 04:29:47 -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=C25sKiNg; 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 S232278AbiI3L1A (ORCPT + 99 others); Fri, 30 Sep 2022 07:27:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232155AbiI3L02 (ORCPT ); Fri, 30 Sep 2022 07:26:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDE7A17586; Fri, 30 Sep 2022 04:18:49 -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 5875A62299; Fri, 30 Sep 2022 11:18:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B809DC4347C; Fri, 30 Sep 2022 11:18:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664536728; bh=G3/t3BDJDz9EMHp0QOUkv/5jjrPwNlRd22Dc40GCbVw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C25sKiNghUeIo8SwmYaYrlE+zqQ8SiqFO1YRyhXnVgyCIbnfvq9wmQYyiIqF4zFsv rSZh+fnIP5m63rqFcDKETiVW/X9XMxJme7LIGk8zgSkJCNKnKqPFNjX2YVRgqO0Xat pWCw1FipBPRWr9MCej2o/JrTvT7fANuSyH5vsOxqloZ99kutXIsgZTaKLP4MJneiPb 90+iOUXbBP+d+xXmnjJF3BjfZ0AmRT95opCBPYg28qO6uaZrehTC9U1CH6OnxdBMkq xg7JPVll9IPj7BrNU4AUfgIJ9QGSRvH+Tw/ZwggNIU1uq90lmtvvXkR1AUTBLtyBgB fhIcj1YFTc/aA== From: Jeff Layton To: tytso@mit.edu, adilger.kernel@dilger.ca, djwong@kernel.org, david@fromorbit.com, trondmy@hammerspace.com, neilb@suse.de, viro@zeniv.linux.org.uk, zohar@linux.ibm.com, xiubli@redhat.com, chuck.lever@oracle.com, lczerner@redhat.com, jack@suse.cz, bfields@fieldses.org, brauner@kernel.org, fweimer@redhat.com Cc: linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, ceph-devel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-nfs@vger.kernel.org, linux-xfs@vger.kernel.org, Colin Walters Subject: [PATCH v6 2/9] iversion: clarify when the i_version counter must be updated Date: Fri, 30 Sep 2022 07:18:33 -0400 Message-Id: <20220930111840.10695-3-jlayton@kernel.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220930111840.10695-1-jlayton@kernel.org> References: <20220930111840.10695-1-jlayton@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 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 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 The i_version field in the kernel has had different semantics over the decades, but NFSv4 has certain expectations. Update the comments in iversion.h to describe when the i_version must change. Cc: Colin Walters 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 6755d8b4f20b..9925cac1fa94 100644 --- a/include/linux/iversion.h +++ b/include/linux/iversion.h @@ -9,8 +9,14 @@ * --------------------------- * 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 larger to observers if there was an explicit change to the inode's + * data or metadata since it was last queried. + * + * An explicit change is one that would ordinarily result in a change to the + * inode status change time (aka ctime). i_version must appear to change, even + * if the ctime does not (since the whole point is to avoid missing updates due + * to timestamp granularity). If POSIX mandates that the ctime must change due + * to an operation, then the i_version counter must be incremented as well. * * 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 -- 2.37.3