Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp3231704rwo; Mon, 24 Jul 2023 08:07:33 -0700 (PDT) X-Google-Smtp-Source: APBJJlG3306jeW7Y3Mb2bDipAR7vGGLAbYW4ovcukqeyhWbftWgeLwt3FMx/ieLLQOSIBD/uw36B X-Received: by 2002:a2e:8784:0:b0:2b6:fca2:fc6e with SMTP id n4-20020a2e8784000000b002b6fca2fc6emr6261178lji.42.1690211253112; Mon, 24 Jul 2023 08:07:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690211253; cv=none; d=google.com; s=arc-20160816; b=yU8w0TvLejqVrkqnL216kL6LK2DqUuQuNeG+GNlLitS2M5rgJn7BUjj2r21MoSppJy v8KfPhwmtRoBScK/z91lS6yiq2uZRKuuth9AL+RWgu3Cc7KYz2SqYK3B/n+KfyHEMmPB FHXje0mFLkhEXLdbdYvj4BZXeBwLdGvt1Av80IAU2hHqXPtNKcg19hCqzpmTSi6OuxiY ML3PbRNNc/tJ+zg8Im9cyhYXK6IVhPcJCSCGvpbmZEK8NzFQ42TxQKvTjhLcMh52mBhK dKc3OikWEqo30/bogNxaXr1An6vkoB1r0AoCrvOhhJxnpz1weiu+YDEGurIy1J+r9wIV LH2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=+3k8UmhrleTiruZ6tIR7/toj6qHsvi4oTFyb++oaJOw=; fh=7kqWyKiIQpgkLC2sS92h74MY/UjqV8MeZaswkbSb4vE=; b=jtnovL87sqSeyaPMK9RHknMPa8ZI6NUqhRmS2antpnKnRZq1q3WkFPf4OwdoXPabLx Fnn94k7rqHESTkn0T4YBFuTUEe1zQYvvo6mYB33duyx910nnxlOpkYPomaJnRLpGQR/Y Gi7Ff+ri/mASKuqb294yIm2sPp4xcx16aDC3K2DyUeanGrAqapTpOKUNbqrLzLmVR+jT P1LbV95XFN7PInv6Nqir7iuKjX0R3utKszoiDMkaUljlBhyxmIJA0gD7j+rj/UsJo5HX vleh+cEmvs++p3KvktiBQCAeVMrfG9nBnxOIpywq8fLow59bg2DhTYNQSeS5bxAWIur5 X55g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Hyaiu9wK; 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 j8-20020a170906830800b009591dd6c71esi6653443ejx.896.2023.07.24.08.06.55; Mon, 24 Jul 2023 08:07:33 -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=Hyaiu9wK; 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 S229790AbjGXOxs (ORCPT + 99 others); Mon, 24 Jul 2023 10:53:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229670AbjGXOxr (ORCPT ); Mon, 24 Jul 2023 10:53:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 331A810C7; Mon, 24 Jul 2023 07:53:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BCBBA611CE; Mon, 24 Jul 2023 14:53:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7962AC433CA; Mon, 24 Jul 2023 14:53:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690210426; bh=JvxzI2ec4nmjfcSx7Dk5ZGMMTg3mm1W+45Wt9adUQn0=; h=From:Date:Subject:To:Cc:From; b=Hyaiu9wKl1597Jykx6MIkp3p2w9NyKmkR46knQGiHN+WHxcQuZ8zqKcD1C4FUkjNE HrW3fjhHWmG4gaVE6NxDtdc76VEWgurYVISMJra3uh8JaJ+U35YQ16E5NkU0YdTt3b jBYsXGa3ji/BiaOxYVqTjxdIBH1+zgqOCXny6S2zztvDOAK0192iG+MMQ1KdJvWBdw wItdKVoH8hcFCSh/UXRDwbaYSZDTEcvIvOnEYySwOc5CtLkamD94CSB/MDiZVZgPyG ZRw7JIJysp2P4UqjOIhOMgnNoT65YXvD5K8MzUbJ9dbgQL4sqVo/A9dXqWfBAhWQVz GGZ+2DI6XvhnA== From: Jeff Layton Date: Mon, 24 Jul 2023 10:53:39 -0400 Subject: [PATCH RFC] nfsd: set missing after_change as before_change + 1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230724-bz2223560-v1-1-b6da868c0fc6@kernel.org> X-B4-Tracking: v=1; b=H4sIAHKQvmQC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDI2MDcyMT3aQqIyMjY1MzA13T1BSzpGTjRNOUJHMloPqCotS0zAqwWdFKQW7 OSrG1tQC4mS3XYAAAAA== To: Chuck Lever , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Jeff Layton X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1219; i=jlayton@kernel.org; h=from:subject:message-id; bh=JvxzI2ec4nmjfcSx7Dk5ZGMMTg3mm1W+45Wt9adUQn0=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBkvpB5K3xyXadUePxkbITjV0wr5i3sW9yPqwRuH fq29BBvN0WJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZL6QeQAKCRAADmhBGVaC FauDD/0S+0CLT+t0uMc0+7sYPkn462IXnlMUmCDYC4Uf2epjFLYX+Lpjoq9e3AlQRNjV7lM7fXa 1IuP7V+HONzuV5H0X0C8ZQRaMngyMA1v6WpEGyYZivvecwLmlvcO0WS1bAnFXc1gldE3SPfTEgB IFqDqcKFEAclOeAkslrXM++Q8vON7icGc9pAud23iWZFXg4NqGKcktWvKPLyi8kzF38W44LuUBc IiKLNjoinEhpfst2C0q9181By19+INvO9q592rYRAJisU6HRut7lpZ6Yb/xgOtB6vYDwhjhFJOy xXRsIftqYy2e6IHMLBnZygXG6Dt14Y8qlaHxGGFloFJzEDlrcnYpX/LCiAfAz4/fiID97zjyN7/ cnqL+e4U3oDEoGJ1W+CvIeFX/iAurm0rGr569jtzrqzm8MzPw8Xf1CdDFaMmJkyq6mwxOFkgCZ2 HqecpHrzFKkVu2Jm+qJMyMIPBZBEHdp7N2ebzkOWNiKTGQ5sevrGfCN6yvrJ2Y+d8uWois0uhUk T1OfKn6H8Sp8JGU1cJYJSHASAqA+pfuYot3HEAzrHWI/dGQSiatrpVGLT53yX8lQxIpbs6aVKfW DdrtMrAC++R23oX2IA/SpJYz1CcT6HkMo+Mu4pReJUeDKgdzWJaulo4p4GDaudxzlXNo6X2w51D A9CryTIjyVsUaZA== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, 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 In the event that we can't fetch post_op_attr attributes, we still need to set a value for the after_change. The operation has already happened, so we're not able to return an error at that point, but we do want to ensure that the client knows that its cache should be invalidated. If we weren't able to fetch post-op attrs, then just set the after_change to before_change + 1. The atomic flag should already be clear in this case. Suggested-by: Neil Brown Signed-off-by: Jeff Layton --- fs/nfsd/nfs4proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 3f6710c9c5c9..f0f318e78630 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -411,7 +411,7 @@ set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp) if (WARN_ON_ONCE(!fhp->fh_pre_saved)) cinfo->before_change = 0; if (!fhp->fh_post_saved) - cinfo->after_change = 0; + cinfo->after_change = cinfo->before_change + 1; } static __be32 --- base-commit: 97a5d0146ef443df148805a4e9c3c44111f14ab1 change-id: 20230724-bz2223560-5ed6bc3a5db7 Best regards, -- Jeff Layton