Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1031161rdg; Wed, 11 Oct 2023 12:12:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFBD0v2KfZD8tPrLYZzx8koVHt5fj2DUpRK9B3FHvfo6OKnMQf5i9Fej2pTji/Hrxfftcn8 X-Received: by 2002:a05:6a21:a599:b0:153:39d9:56f8 with SMTP id gd25-20020a056a21a59900b0015339d956f8mr27992008pzc.15.1697051537096; Wed, 11 Oct 2023 12:12:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697051537; cv=none; d=google.com; s=arc-20160816; b=lFWHyPeSMRFc2LUML5JdhD1zg0hwD38i8ueL7NKmZIqRnUZbfPDti4qEDhMDJ1zih5 rIUeK2WPUf6pnbWgk2/S1LdChUozcA0PTpdpDGMLHbnF5iBjWS3s924iXsWzKrIcVWwD /B+1l4qbQcwQBV3u7SwGFPQpad4ijlPkVEKXGkcod65mfc1CVXY5FRAqXYpaqxAZp2jJ swEinsDeJguTvq9i98+S2aPJ8I4H5cY50wANoXnBftdRlEuj4FP/PKqCtZlO7T35Ky1p f8bVJM3bT8QCfsxz9tGsx9fvT6T0pappZC2AFoEdnTqNdKe+H3BGvOaKszwccNsGoU4y VqiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=JxsbHVtApRIp9rpx3MABhxBp2730xhiO0DRbHZJNvEs=; fh=H7k8NuAUh6AKj7Fh2O7ReCdGwD6b1WAvYVN6xWHbpuM=; b=eZLsiinav9aF4epd4VqOo2efKgQaCG8WBg6NtnYjiKx9CXT0haeDMYk3y/Cf87Q/UM OpR1glE5YdVwWL1B/2972LTsVC6eea/+sCR9p2VEaPACO3eG6jEDcGfDkECD+/VEXXmV qKqqNqqr5CuMSRrwMn61GdSiEEWje8jV3z+o6Xv25gIrhkkcP5vjSYDjtmZYzUEQ2Fqe 8FO5NRg3vrNK8GXieuKWd/Pyy5XPJDRhu3rUZejBE/USVh3TOekBZs6LUtc/rpjesicx pklANr0OcumaWxkdI/R5pYYOeVo9KL0ojvfASmGT0A0/8AHHib5cgCR6k1ijkv6efcbs L2vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Jl0E2Pjd; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id cl4-20020a056a0032c400b0068a5877bfaesi12728679pfb.382.2023.10.11.12.12.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 12:12:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Jl0E2Pjd; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 651488116E4B; Wed, 11 Oct 2023 12:12:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232743AbjJKTMD (ORCPT + 99 others); Wed, 11 Oct 2023 15:12:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232224AbjJKTMD (ORCPT ); Wed, 11 Oct 2023 15:12:03 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A34598F; Wed, 11 Oct 2023 12:12:01 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42383C433C7; Wed, 11 Oct 2023 19:12:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697051521; bh=It2LkzgcfBOst3Wh1aN+gatu/fkADJhMweGlc+NHALo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Jl0E2PjdjeYZKN2MtbJugaZFPdz1gVb9M8/mUf7FTUOljrlilqjgJ3290JLNNH+HM ngKoDfORErP1av+MAmOHOUgTQzOkbvxWnCcmQEs2m/gDCBpu5hSHYlwOA6YHTIjbVm o0xxEsJVYt3JOYOYNxVqWHIo67BkwQ6F+pfLYnbgAb1Q51oWUAfUi9voF6kjVIeeYU ldlfvPiIimOfIDq4ug9Yh19SXYlqzBk7AjAF+TwvnDMk2dQ6ih8O4s/EInSXbuw3mv 4IyiMMXEIXYzE9Hie20sHLDp3NNuwil1/26+OJRA+O3jaaMkF53MA1bk/gpeZ3VTOi p1fHUdFXDvxTg== Date: Wed, 11 Oct 2023 12:12:00 -0700 From: "Darrick J. Wong" To: Jeff Layton Cc: Chandan Babu R , Chuck Lever , linux-nfs@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, brauner@kernel.org Subject: Re: [PATCH] xfs: reinstate the old i_version counter as STATX_CHANGE_COOKIE Message-ID: <20231011191200.GA21277@frogsfrogsfrogs> References: <20230929-xfs-iversion-v1-1-38587d7b5a52@kernel.org> <20231011154938.GL21298@frogsfrogsfrogs> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 11 Oct 2023 12:12:14 -0700 (PDT) X-Spam-Level: ** On Wed, Oct 11, 2023 at 11:51:08AM -0400, Jeff Layton wrote: > On Wed, 2023-10-11 at 08:49 -0700, Darrick J. Wong wrote: > > On Wed, Oct 11, 2023 at 09:09:38AM -0400, Jeff Layton wrote: > > > On Fri, 2023-09-29 at 14:43 -0400, Jeff Layton wrote: > > > > The handling of STATX_CHANGE_COOKIE was moved into generic_fillattr in > > > > commit 0d72b92883c6 (fs: pass the request_mask to generic_fillattr), but > > > > we didn't account for the fact that xfs doesn't call generic_fillattr at > > > > all. > > > > > > > > Make XFS report its i_version as the STATX_CHANGE_COOKIE. > > > > > > > > Fixes: 0d72b92883c6 (fs: pass the request_mask to generic_fillattr) > > > > Signed-off-by: Jeff Layton > > > > --- > > > > I had hoped to fix this in a better way with the multigrain patches, but > > > > it's taking longer than expected (if it even pans out at this point). > > > > > > > > Until then, make sure we use XFS's i_version as the STATX_CHANGE_COOKIE, > > > > even if it's bumped due to atime updates. Too many invalidations is > > > > preferable to not enough. > > > > --- > > > > fs/xfs/xfs_iops.c | 5 +++++ > > > > 1 file changed, 5 insertions(+) > > > > > > > > diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c > > > > index 1c1e6171209d..2b3b05c28e9e 100644 > > > > --- a/fs/xfs/xfs_iops.c > > > > +++ b/fs/xfs/xfs_iops.c > > > > @@ -584,6 +584,11 @@ xfs_vn_getattr( > > > > } > > > > } > > > > > > > > + if ((request_mask & STATX_CHANGE_COOKIE) && IS_I_VERSION(inode)) { > > > > + stat->change_cookie = inode_query_iversion(inode); > > > > + stat->result_mask |= STATX_CHANGE_COOKIE; > > > > + } > > > > + > > > > /* > > > > * Note: If you add another clause to set an attribute flag, please > > > > * update attributes_mask below. > > > > > > > > --- > > > > base-commit: df964ce9ef9fea10cf131bf6bad8658fde7956f6 > > > > change-id: 20230929-xfs-iversion-819fa2c18591 > > > > > > > > Best regards, > > > > > > Ping? > > > > > > This patch is needed in v6.6 to prevent a regression when serving XFS > > > via NFSD. I'd prefer this go in via the xfs tree, but let me know if > > > you need me to get this merged this via a different one. > > > > Oh! Right, this is needed because the "hide a state in the high bit of > > tv_nsec" stuff got reverted in -rc3, correct? So now nfsd needs some > > way to know that something changed in the file, and better to have too > > many client invalidations than not enough? And I guess bumping > > i_version will keep nfsd sane for now? > > > > If the answers are [yes, yes, yes] then: > > Reviewed-by: Darrick J. Wong > > Yes, yes, and yes. Can you guys shepherd this into mainline? Chandan, can you queue this (and the other xfs fixes I sent) for -rc6? --D > Thanks for the R-b! > -- > Jeff Layton >