Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp4742997rwb; Mon, 8 Aug 2022 06:25:00 -0700 (PDT) X-Google-Smtp-Source: AA6agR4yBur04NNDIlvuLwMR5e6XejymyLcaym+j84W2Z0WcgijAzlPM1DVcpHoeBS/5ZmyKVIYf X-Received: by 2002:a05:6a00:4147:b0:52e:2d56:17c8 with SMTP id bv7-20020a056a00414700b0052e2d5617c8mr18439931pfb.51.1659965100407; Mon, 08 Aug 2022 06:25:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659965100; cv=none; d=google.com; s=arc-20160816; b=Xz3fOvuhu51AAIB6GxoiZsWB2VSbNqvwzL4VjLzDqOF1A4ZeIqnUfSsVP10kNSnUt5 E/XIYZ4VdhP88YFjIjQXrtmw1bD1YK1Jc0UgUl6rMJRJ7XC8zykAnScj17pxO4zpc7uE f2PqQgtPjFqq5N4Duo6r4R2MpO2LGsnIr3ibUAVXnG6D/+wJPXIcRKSRJ+YD8oievkbK xkowM6R8sXQVUe7Q0kpFuWdGnUH/EyNd5VNTaYlW0LzKyDoFoPKMs5DOyUfrxH0e9A8r k5Hf02dZcZDt2Fz8Yj+XJdWtzIsAtlhNyWXo3p32+Wjp+U2CWGqouNvjbKqYxrXHtkjy SSKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=LFUU6+Y12mgkxQEtu2vGZfVH0/4+aYHNi9ElACK5cCw=; b=qhuJA6W/G9hVaGuXjdWM0l2zzPD1ZYha0OkBPVXzN1xlxbEDojJYfMwqMj6TkoqETi r1z7o5RZpeVJoy3KY9OoLU0HSWnFbLx4v2jCZFSqwhBPoauxh3ZGi0vIBWf3TVnURPmF OEIkkkFS7bYAsuWGYB6aXj60mohm2SxIs6o/1vJ84y5UgCrpD4WdYqgUlS4oXmxr7T+g nyjp5/zwwywPm5I5LQH97Larthi9m95T9gcIrANfalF5x2ZiadRzQRTwr4vnYmCN4Oq6 qcYRbg4dpkrz9m24so2TtyrzBAV465O9Z1QfDtw41T8zXhLQk9tOi28pLGewLvyTyg3o b8Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Yh3mbFYz; 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 i193-20020a6287ca000000b0052abccd715csi7410106pfe.118.2022.08.08.06.24.21; Mon, 08 Aug 2022 06:25:00 -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=Yh3mbFYz; 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 S242788AbiHHNTN (ORCPT + 99 others); Mon, 8 Aug 2022 09:19:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242568AbiHHNTM (ORCPT ); Mon, 8 Aug 2022 09:19:12 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 277715FA9; Mon, 8 Aug 2022 06:19:11 -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 sin.source.kernel.org (Postfix) with ESMTPS id 7F45DCE1099; Mon, 8 Aug 2022 13:19:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B482AC433C1; Mon, 8 Aug 2022 13:19:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659964747; bh=WbW+9qCSkRr5VwrXe92AgJ0Tev43dg13deHgbic44V4=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=Yh3mbFYzZUnNBxKTPwVezwm6HiAsFsHl5nh1qlT6WKVAvyKnTLsie9XVJ3mifX07k VYMusmLxyzuAc7Nc7HK1jWeBytVwnj4PLC3uucfYB9tDslEyU7Z+E5xDlGWpkprpTV DnCaWPnU8jTItqadwNDXS/cl140h8pWYlnbtO6XbdfdIiZvve8FSyNwJTs3twYIfLT jbIPZAo/WY6HQSxRtv9vY6W0VM0hYJed4l+VKBCB9ZdqrNh/cTUjjlAIC9ZSbPYT+Z nCb53y++ylMfbGRnsGYC2Pi17nCbIX3v659yZBDQdNt/PW08Wo3dt3X3CmjhZcZoAJ 0GnPt+Tsn71PQ== Message-ID: <33176ee0f896aef889ad1930fb1e008323135a2e.camel@kernel.org> Subject: Re: [RFC PATCH 1/4] vfs: report change attribute in statx for IS_I_VERSION inodes From: Jeff Layton To: Dave Chinner Cc: linux-fsdevel@vger.kernel.org, dhowells@redhat.com, lczerner@redhat.com, bxue@redhat.com, ceph-devel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-afs@lists.infradead.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org, fstests Date: Mon, 08 Aug 2022 09:19:05 -0400 In-Reply-To: References: <20220805183543.274352-1-jlayton@kernel.org> <20220805183543.274352-2-jlayton@kernel.org> <20220805220136.GG3600936@dread.disaster.area> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.3 (3.44.3-1.fc36) MIME-Version: 1.0 X-Spam-Status: No, score=-7.7 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 On Fri, 2022-08-05 at 18:06 -0400, Jeff Layton wrote: > On Sat, 2022-08-06 at 08:01 +1000, Dave Chinner wrote: > > On Fri, Aug 05, 2022 at 02:35:40PM -0400, Jeff Layton wrote: > > > From: Jeff Layton > > >=20 > > > Claim one of the spare fields in struct statx to hold a 64-bit change > > > attribute. When statx requests this attribute, do an > > > inode_query_iversion and fill the result in the field. > > >=20 > > > Also update the test-statx.c program to fetch the change attribute as > > > well. > > >=20 > > > Signed-off-by: Jeff Layton > > > --- > > > fs/stat.c | 7 +++++++ > > > include/linux/stat.h | 1 + > > > include/uapi/linux/stat.h | 3 ++- > > > samples/vfs/test-statx.c | 4 +++- > > > 4 files changed, 13 insertions(+), 2 deletions(-) > > >=20 > > > diff --git a/fs/stat.c b/fs/stat.c > > > index 9ced8860e0f3..976e0a59ab23 100644 > > > --- a/fs/stat.c > > > +++ b/fs/stat.c > > > @@ -17,6 +17,7 @@ > > > #include > > > #include > > > #include > > > +#include > > > =20 > > > #include > > > #include > > > @@ -118,6 +119,11 @@ int vfs_getattr_nosec(const struct path *path, s= truct kstat *stat, > > > stat->attributes_mask |=3D (STATX_ATTR_AUTOMOUNT | > > > STATX_ATTR_DAX); > > > =20 > > > + if ((request_mask & STATX_CHGATTR) && IS_I_VERSION(inode)) { > > > + stat->result_mask |=3D STATX_CHGATTR; > > > + stat->chgattr =3D inode_query_iversion(inode); > > > + } > >=20 > > If you're going to add generic support for it, shouldn't there be a > > generic test in fstests that ensures that filesystems that advertise > > STATX_CHGATTR support actually behave correctly? Including across > > mounts, and most importantly, that it is made properly stable by > > fsync? > >=20 > > i.e. what good is this if different filesystems have random quirks > > that mean it can't be relied on by userspace to tell it changes have > > occurred? >=20 > Absolutely. Being able to better test the i_version field for consistent > behavior is a primary goal. I haven't yet written any yet, but we'd > definitely want something in xfstests if we decide this is worthwhile. I started writing some tests for this today, and hit a bit of a chicken- and-egg problem: I'd prefer to use xfs_io for easier maintainability, but the STATX_* constants are defined via UAPI header. Older kernels don't have them and old xfs_io programs don't understand or report this value. Should I just write a one-off binary program for xfstests to fetch this value for now, or are we better off merging the patchset first, and then fix xfs_io and then write the tests using the updated xfs_io program? --=20 Jeff Layton