Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp321235rwn; Wed, 7 Sep 2022 17:32:49 -0700 (PDT) X-Google-Smtp-Source: AA6agR6VHqp/nPJJQl0TaVv/dtiAg+zQrtFRWY4FUf/Eq4TenI6HroABhZT83WqGOVmWou39HRtN X-Received: by 2002:aa7:da4f:0:b0:44e:864b:7a3e with SMTP id w15-20020aa7da4f000000b0044e864b7a3emr5100344eds.378.1662597169214; Wed, 07 Sep 2022 17:32:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662597169; cv=none; d=google.com; s=arc-20160816; b=Uzm0zA9Bx4nFMoOrm43PP00xU0igo/snkpu3tcgNY6mXVrevatp2o4VIO7sWtnPiV4 jtEcOBXTeYjYAx5esZLsvW/tcsBjhN3lMcWxVj3dlI+t1BPIQv8JlMVwm3/MlmsDxW3x Wy9Y7knqizVHW6eoXnsDAm4aTl1baIloibBBMHUNCSfg27cO5B4EfWrCsw5BkMPq/UAl SnKdlObPCQJ33nZ1IcWS9I8Lp/zHWyNgJeKE/PdpJDN20miF2Ce4yBtYoccKbVVSTB8w iQ/Pg3T2iCyDUlxpAvsb56iGciRSh+nHpmuHZ9O9EzbT4ep2/ElL63D4iyq+ulCvGKcE 6JUw== 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=jZL4IIR5pfW+dB6M5aYU+c6C39aV8z8lPkflRrG+URU=; b=GEFpp/Q1ovC0t1c8e78SE48wiM0MtFrOMP6WFqKl6VSQicwkOCd1CqYVjo3l4t2OyA VNlG4bKUB+2iQqi0fUFNy8LP4zC3LWTG6hOBV+dTJRBpU8+5H0HO78dp5+wlf9zCx/cl WVMcFZNg2SNf7TUQ0UzMCPQZ3Cj/WKR1X47intp+vuI+T6PFKMPWtl4I0/rN8JJgNM7h 1N26de0Xqu0OvIh3Hs+1ocR30tmQO0HiyQwyG0jQpLnnxPYpJzVxTW8KOaSH2grzpVpk tA3GXJqMYCyXr8M4BcaOOs3aC9gpEL60NQPe8YKkYU9p+zhbzzzZnMIZ2UJlR+HKzerQ YpgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="xhWsmma/"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=2EZ00t47; 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=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w20-20020a056402269400b00447d32305f7si4556877edd.54.2022.09.07.17.32.13; Wed, 07 Sep 2022 17:32:49 -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=@suse.de header.s=susede2_rsa header.b="xhWsmma/"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=2EZ00t47; 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=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229793AbiIHAbo (ORCPT + 99 others); Wed, 7 Sep 2022 20:31:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230272AbiIHAba (ORCPT ); Wed, 7 Sep 2022 20:31:30 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98145D0773; Wed, 7 Sep 2022 17:31:21 -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-out2.suse.de (Postfix) with ESMTPS id 1848620A08; Thu, 8 Sep 2022 00:31:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1662597080; 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=jZL4IIR5pfW+dB6M5aYU+c6C39aV8z8lPkflRrG+URU=; b=xhWsmma/D1pNOJcXcAyNNudzKTd5IWeA/c3+FbDta8nGJ9qkuCHDG9GQnSG9PdnN7/Skva HsIr1gy0WdeX8JatYzy3I+CQoAKtNUuQbd3xK9c1D/uq4a2OrhuBOXUELws2TMEbsDzqiJ tVQZ0rCVKHwC5Y+ZngpvHcwx+/Vu5Vc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1662597080; 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=jZL4IIR5pfW+dB6M5aYU+c6C39aV8z8lPkflRrG+URU=; b=2EZ00t47e/GkOmNlEyHEtudCQMs17PgOGXfuHHWD2eWfRmG6ZTcBs00W3KzPNFGPfmK2ne xklLIOrqfjDbRwAQ== 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 8B3DE1322C; Thu, 8 Sep 2022 00:31:12 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id odUxENA3GWPrBgAAMHmgww (envelope-from ); Thu, 08 Sep 2022 00:31:12 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: "NeilBrown" To: "Trond Myklebust" Cc: "bfields@fieldses.org" , "jlayton@kernel.org" , "zohar@linux.ibm.com" , "djwong@kernel.org" , "xiubli@redhat.com" , "brauner@kernel.org" , "linux-api@vger.kernel.org" , "linux-xfs@vger.kernel.org" , "david@fromorbit.com" , "fweimer@redhat.com" , "linux-kernel@vger.kernel.org" , "chuck.lever@oracle.com" , "linux-man@vger.kernel.org" , "linux-nfs@vger.kernel.org" , "tytso@mit.edu" , "viro@zeniv.linux.org.uk" , "jack@suse.cz" , "linux-ext4@vger.kernel.org" , "linux-btrfs@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "lczerner@redhat.com" , "adilger.kernel@dilger.ca" , "ceph-devel@vger.kernel.org" Subject: Re: [man-pages RFC PATCH v4] statx, inode: document the new STATX_INO_VERSION field In-reply-to: <8a71986b4fb61cd9b4adc8b4250118cbb19eec58.camel@hammerspace.com> References: <20220907111606.18831-1-jlayton@kernel.org>, <166255065346.30452.6121947305075322036@noble.neil.brown.name>, <79aaf122743a295ddab9525d9847ac767a3942aa.camel@kernel.org>, <20220907125211.GB17729@fieldses.org>, <771650a814ab1ff4dc5473d679936b747d9b6cf5.camel@kernel.org>, <8a71986b4fb61cd9b4adc8b4250118cbb19eec58.camel@hammerspace.com> Date: Thu, 08 Sep 2022 10:31:08 +1000 Message-id: <166259706887.30452.6749778447732126953@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,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 On Wed, 07 Sep 2022, Trond Myklebust wrote: > On Wed, 2022-09-07 at 09:12 -0400, Jeff Layton wrote: > > On Wed, 2022-09-07 at 08:52 -0400, J. Bruce Fields wrote: > > > On Wed, Sep 07, 2022 at 08:47:20AM -0400, Jeff Layton wrote: > > > > On Wed, 2022-09-07 at 21:37 +1000, NeilBrown wrote: > > > > > On Wed, 07 Sep 2022, Jeff Layton wrote: > > > > > > +The change to \fIstatx.stx_ino_version\fP is not atomic with > > > > > > respect to the > > > > > > +other changes in the inode. On a write, for instance, the > > > > > > i_version it usually > > > > > > +incremented before the data is copied into the pagecache. > > > > > > Therefore it is > > > > > > +possible to see a new i_version value while a read still > > > > > > shows the old data. > > > > >=20 > > > > > Doesn't that make the value useless? > > > > >=20 > > > >=20 > > > > No, I don't think so. It's only really useful for comparing to an > > > > older > > > > sample anyway. If you do "statx; read; statx" and the value > > > > hasn't > > > > changed, then you know that things are stable.=20 > > >=20 > > > I don't see how that helps.=C2=A0 It's still possible to get: > > >=20 > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0reader=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0writer > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0------=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0------ > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0i_version++ > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0statx > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0read > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0statx > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0update page cache > > >=20 > > > right? > > >=20 > >=20 > > Yeah, I suppose so -- the statx wouldn't necessitate any locking. In > > that case, maybe this is useless then other than for testing purposes > > and userland NFS servers. > >=20 > > Would it be better to not consume a statx field with this if so? What > > could we use as an alternate interface? ioctl? Some sort of global > > virtual xattr? It does need to be something per-inode. >=20 > I don't see how a non-atomic change attribute is remotely useful even > for NFS. >=20 > The main problem is not so much the above (although NFS clients are > vulnerable to that too) but the behaviour w.r.t. directory changes. >=20 > If the server can't guarantee that file/directory/... creation and > unlink are atomically recorded with change attribute updates, then the > client has to always assume that the server is lying, and that it has > to revalidate all its caches anyway. Cue endless readdir/lookup/getattr > requests after each and every directory modification in order to check > that some other client didn't also sneak in a change of their own. NFS re-export doesn't support atomic change attributes on directories. Do we see the endless revalidate requests after directory modification in that situation? Just curious. Thanks, NeilBrown