Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1218351rwn; Thu, 8 Sep 2022 15:42:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR6f85p4FFPS8OSr7rLetEjHHp1RH+OyulzJK3meglxjddCY0naNMVXjwYmpbUTLYt5+Lm1C X-Received: by 2002:a05:6512:2388:b0:498:f8e3:5a34 with SMTP id c8-20020a056512238800b00498f8e35a34mr37263lfv.453.1662676971518; Thu, 08 Sep 2022 15:42:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662676971; cv=none; d=google.com; s=arc-20160816; b=OE25dO7VztOCu92PHDDmnhBSiVUMijqXxQyE+02H/MfRyHR0X5umdZdQ/mlPUVx+Rd WQrjlkZIeG3Le7c0LV2X7FeAIhn14BCWSOKI2XkLkiDezHhZ6NRyHfoUlA3rWNlVd5hm VQ50bnwaCbSCT/idK7CY6is2h5J/OGeOy7b7ofYjQQZrcLdNyrWltvrUfdNMDSuhgHLR qyDEttCROjPJeVFW6rIM3RzwYd2A22o/BQY0TlCNpks2PndbbFZPLJcqa4n4R6D3bx3h WmKQ7+inNvdW+hr2JNSd0WkE9+fNFMiRWbq6PzcYoxjPzrCcBYL5TnrWXOIY1Qje+5WQ qdeg== 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=39pzd2H+Q2np9tNPeeLt0hZVac57Ld4M0d4EpbTDzso=; b=ejFzqyI87mlLgsLkVhhYtYcBWosn3TOZGP6nNM2sji1oSbsTLLSndlVzk/GMvajWPe PdZh+MnOAkQye6HDCN6IoOEhkmz+OfCUNEYI7Sez8h011drvh87tDd9Yy+1JhJgLS2Fs VfKyzmCnBef3Jjo/Xrkr65ila/dkA3v5sU1uHjTr1NEMBj+9dRivtItRsUscIDaScbbF UQcHgv0LBpMOikU/kSHLWI02r2BGxWPyRmqyRnAzvnCn8Wu+G9sJ6AVsCVTdqO/k1sWN PfvU4oneCqy4Rd8fzUk4DFo4F7RfehDa5+WVdzItg3lCN+4gR9OgVG3ETMORkHD7sjSl r2UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=EVICqEQt; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=JA1FXNEd; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-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 v25-20020ac258f9000000b00497a761eac1si22889lfo.427.2022.09.08.15.42.22; Thu, 08 Sep 2022 15:42:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=EVICqEQt; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=JA1FXNEd; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-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 S229948AbiIHWlP (ORCPT + 99 others); Thu, 8 Sep 2022 18:41:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229800AbiIHWlN (ORCPT ); Thu, 8 Sep 2022 18:41:13 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5BAAED3BD; Thu, 8 Sep 2022 15:41:12 -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 5DA7D21EE2; Thu, 8 Sep 2022 22:41:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1662676871; 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=39pzd2H+Q2np9tNPeeLt0hZVac57Ld4M0d4EpbTDzso=; b=EVICqEQt1WJTp5oZeW9lXiYAxJDBR8d9kFj/KsgIa2ZQqqj1/1hgX+RhYnaa8RtaQGB8v9 YFNE0vglYXwK0J64710bHzjyX4Q7iMIiU6EgQTOFb+43nM6kBU4hjywfL5Ww7V1rwDy6hh GKewm2g3sQQZnUXz7pgv1U2tUq8Xw7U= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1662676871; 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=39pzd2H+Q2np9tNPeeLt0hZVac57Ld4M0d4EpbTDzso=; b=JA1FXNEdw0SSrND/axgRnsiCBodxCRELCCnti65e/mgOESNzYwt4gTvp8SWuivGtScAbON uDmCA8c4B1Fr9kDw== 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 AE9DC1322C; Thu, 8 Sep 2022 22:41:03 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id HARlGH9vGmPiCgAAMHmgww (envelope-from ); Thu, 08 Sep 2022 22:41:03 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: "NeilBrown" To: "Theodore Ts'o" Cc: "Jan Kara" , "Jeff Layton" , "J. Bruce Fields" , 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, brauner@kernel.org, fweimer@redhat.com, linux-man@vger.kernel.org, linux-api@vger.kernel.org, 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 Subject: Re: [man-pages RFC PATCH v4] statx, inode: document the new STATX_INO_VERSION field In-reply-to: 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>, <20220907135153.qvgibskeuz427abw@quack3>, <166259786233.30452.5417306132987966849@noble.neil.brown.name>, <20220908083326.3xsanzk7hy3ff4qs@quack3>, Date: Fri, 09 Sep 2022 08:40:51 +1000 Message-id: <166267685105.30452.17324304715046746056@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-ext4@vger.kernel.org On Fri, 09 Sep 2022, Theodore Ts'o wrote: > On Thu, Sep 08, 2022 at 10:33:26AM +0200, Jan Kara wrote: > > It boils down to the fact that we don't want to call mark_inode_dirty() > > from IOCB_NOWAIT path because for lots of filesystems that means journal > > operation and there are high chances that may block. > >=20 > > Presumably we could treat inode dirtying after i_version change similarly > > to how we handle timestamp updates with lazytime mount option (i.e., not > > dirty the inode immediately but only with a delay) but then the time wind= ow > > for i_version inconsistencies due to a crash would be much larger. >=20 > Perhaps this is a radical suggestion, but there seems to be a lot of > the problems which are due to the concern "what if the file system > crashes" (and so we need to worry about making sure that any > increments to i_version MUST be persisted after it is incremented). >=20 > Well, if we assume that unclean shutdowns are rare, then perhaps we > shouldn't be optimizing for that case. So.... what if a file system > had a counter which got incremented each time its journal is replayed > representing an unclean shutdown. That shouldn't happen often, but if > it does, there might be any number of i_version updates that may have > gotten lost. So in that case, the NFS client should invalidate all of > its caches. I was also thinking that the filesystem could help close that gap, but I didn't like the "whole filesysem is dirty" approach. I instead imagined a "dirty" bit in the on-disk inode which was set soon after any open-for-write and cleared when the inode was finally written after there are no active opens and no unflushed data. The "soon after" would set a maximum window on possible lost version updates (which people seem to have comfortable with) without imposing a sync IO operation on open (for first write). When loading an inode from disk, if the dirty flag was set then the difference between current time and on-disk ctime (in nanoseconds) could be added to the version number. But maybe that is too complex for the gain. NeilBrown