Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3498794rwb; Mon, 3 Oct 2022 16:23:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4P7s/C7wEFmga5ByU8iouf7OWo0AjGuARvsf7lc0yjnzFVSsQ+7HH1Cdi2GrbE81yWt+qP X-Received: by 2002:a17:907:78b:b0:741:3d29:33d2 with SMTP id xd11-20020a170907078b00b007413d2933d2mr18015806ejb.103.1664839393234; Mon, 03 Oct 2022 16:23:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664839393; cv=none; d=google.com; s=arc-20160816; b=urSrFPkZelNZYwHaxVpdXiSWzd0v8IHsvNiBUpXzMcdWuQodjOAzHHs1eHsO23Dder Mlxx/CNUsPliQ3gmOyZg4+EOCbasPYsScOt0bRCVFiFQy0ihOel+4kHXiSYZbXUn8v8I 12JAzmfu3M5Aps7ffo80pyZbg9lyMKb2ckxxjTfbu68fL2CVoLHu4vWIhxP3/3HIbvy0 BGtUmYTD4Uxle+1ljHHYnqczbUQPyiP4RXmv9VxTGwxpcrsiUfZX6culKDGpGVqvA47R MncJ1rW8WST7L9AMBx2RmOUnPmCS+64xok9W5VYYKsv6ZTmT/dU6CFkEXlT7EBk7GWTf ssXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:references:in-reply-to:subject :cc:to:from:mime-version:content-transfer-encoding:dkim-signature :dkim-signature; bh=/ejKKwxeNyusGZxKnFiJMaJEeeRSK2DzQgo4ydgx89g=; b=QnEAnZU8CPu5+ca7opoY82ldvpmNfhFM2/NARqMrMWVNg/GbS+qlewFVsbHjkV/+JN pMIZYIEyK0T9tZa/LCNmsKHNe+Wd1Dtg2MbO6wSdR4ZlXYkC5J/M0Sg3PjeqpMZszMnq /lTsmNzGnUk8r4S8d7Fx5wRmSGOIz9Ft+DspxWHIz9H+amvZhKos4h6A2Y1NeiIVpFbU UnWnfgowz9azQz+Nxqcof4fAublkvE20TZ3X6RIFwDP9kU9wFnE/UknYDPA5dFk3waNp jjpJN5ftmw2UyRXDC/rC6YecGtfPRRp0N/sjOwDzJmfxNDairzZnk1xLfk+Y8bNovsEV DHuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=VY71chfI; dkim=neutral (no key) header.i=@suse.de header.b=SiXZz3uI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dz11-20020a0564021d4b00b00456ff7eddb3si9815916edb.534.2022.10.03.16.22.47; Mon, 03 Oct 2022 16:23:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@suse.de header.s=susede2_rsa header.b=VY71chfI; dkim=neutral (no key) header.i=@suse.de header.b=SiXZz3uI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229936AbiJCXKd (ORCPT + 99 others); Mon, 3 Oct 2022 19:10:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229699AbiJCXKa (ORCPT ); Mon, 3 Oct 2022 19:10:30 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6C1021807; Mon, 3 Oct 2022 16:10:27 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 5EDB8218A2; Mon, 3 Oct 2022 23:10:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1664838625; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/ejKKwxeNyusGZxKnFiJMaJEeeRSK2DzQgo4ydgx89g=; b=VY71chfImQSzPd3upwKIXL6zNeJZEY8W/YbnIU45MigfkVdmbkemLe/KUgltj/U+66tx6f zLKLx90Ypt+TjTCixH+WXnReGJOO7VjZJY1tfP9Rdi+IuS6MhC9h88IWu0z1QEgpuWc22J l07z2sU3SDnTkASWTnVwIstaSPqUkfs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1664838625; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/ejKKwxeNyusGZxKnFiJMaJEeeRSK2DzQgo4ydgx89g=; b=SiXZz3uIude1n8ftVJhEPSRHiECfuhox4wNzLhvgLOZE1lNFGGyguyvi21JZqq99V44kgw c21CW3cSGaY/tjCQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2EA6B1332F; Mon, 3 Oct 2022 23:10:18 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 0sW6N9prO2M2EwAAMHmgww (envelope-from ); Mon, 03 Oct 2022 23:10:18 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: "NeilBrown" To: "Jeff Layton" Cc: tytso@mit.edu, adilger.kernel@dilger.ca, djwong@kernel.org, david@fromorbit.com, trondmy@hammerspace.com, 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, 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: Re: [PATCH v6 2/9] iversion: clarify when the i_version counter must be updated In-reply-to: <20220930111840.10695-3-jlayton@kernel.org> References: <20220930111840.10695-1-jlayton@kernel.org>, <20220930111840.10695-3-jlayton@kernel.org> Date: Tue, 04 Oct 2022 10:10:14 +1100 Message-id: <166483861470.14457.7243696062075946548@noble.neil.brown.name> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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-kernel@vger.kernel.org On Fri, 30 Sep 2022, Jeff Layton wrote: > 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. >=20 > Cc: Colin Walters > Cc: NeilBrown > Cc: Trond Myklebust > Cc: Dave Chinner > Link: https://lore.kernel.org/linux-xfs/166086932784.5425.17134712694961326= 033@noble.neil.brown.name/#t > Signed-off-by: Jeff Layton > --- > include/linux/iversion.h | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) >=20 > 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 mu= st > - * 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 t= he > + * 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 update= s 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. POSIX doesn't (that I can see) describe when the ctime changes w.r.t when the file changes. For i_version we do want to specify that i_version change is not visible before the file change is visible. So this goes beyond the POSIX mandate. I might be worth making that explicit. But this patch is nonetheless an improvement, so: Reviewed-by: NeilBrown Thanks, NeilBrown > * > * 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 > --=20 > 2.37.3 >=20 >=20