Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp3774709rwo; Mon, 24 Jul 2023 17:00:48 -0700 (PDT) X-Google-Smtp-Source: APBJJlHExwyh3Mq9gMmk5DjPSxZEY1tL9OoXcBvLYKso+O2hZgxHtFbdgskug+t+76DUkBck6yQC X-Received: by 2002:a17:903:18e:b0:1b5:5052:5af7 with SMTP id z14-20020a170903018e00b001b550525af7mr16893957plg.8.1690243248424; Mon, 24 Jul 2023 17:00:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690243248; cv=none; d=google.com; s=arc-20160816; b=qlv684IvVKhQQpdkSEUQwA/QfJOAkOncsWPOD0YnFen9tgG36ljpN5/Oy6aXwE1RKj V4lDgu4B8yxrXL0KfcseQb/gh9iHyJcBvmLRrCy0mU13sUZyd1foQA9KQTMpdPMSz1Wz 1lG+Oj7Mu3M7pyLjo7HZ053Yj+tDpb3HDgWvs58G6OgdtHleJav2OAVsJVoFu94nmhIC CRFIdfWiKfIID81ythFYJQQOYnzgF+NFp8p6fggzYOqn9Xb9EMDvL9A69+vGa+NaPvWY OPhbgiydeNQuDhTTMwgS2aMcHIuwpTI7qikyy8OqQj94SsZvO1iDeEBbVj+C43vrDlxx 0SCQ== 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=RaPsAZgv2K2/b+sXSYIrVCCFrSUdfQerUaqQeMt9zpI=; fh=ighsGdGASZOK9EmZN68euKAU4C8j/s2lDVYEAhLyRWg=; b=PE7k1+hi5/K6TdiLKZWcNPvvOwTj+LJ40llAivhqW0D5Zs0L4I/E0sMOIgzM1bQObf U394NSiqsbB6Z89WrOUt6PU6yyAm7LBA4WWbdVL80huWnDbWP3LRdrhDxpjqu8VF4ppY HFaP/dLQRKNy+8CuXlpQx7ytLx9Z/frF/MM7huU/HNIaevZYeAQe7WUvviPjK6QX4AD9 VwTrJKBS2hSObXJlwsmazZegq7+LYKxWdO4qh/PRvbvF3gy8msQCLPEu5BTDk/VPF5te ReU81+8He1aO32FvsDPAWGMMV8VVKbj6A2F9/zKXq0HW2DLVgc9sE815ChUTb9GVu4qR R7ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=r2yyUIvK; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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 u11-20020a170902e5cb00b001b8c4021be9si11060951plf.397.2023.07.24.17.00.25; Mon, 24 Jul 2023 17:00:48 -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=r2yyUIvK; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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 S229712AbjGXXPy (ORCPT + 99 others); Mon, 24 Jul 2023 19:15:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbjGXXPx (ORCPT ); Mon, 24 Jul 2023 19:15:53 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7530610FA; Mon, 24 Jul 2023 16:15:52 -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 1852221FFC; Mon, 24 Jul 2023 23:15:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1690240551; 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=RaPsAZgv2K2/b+sXSYIrVCCFrSUdfQerUaqQeMt9zpI=; b=r2yyUIvKP01oICrwkvG1YvS1jMv1xiBCN8zfLXQD2Rb4xVKtdsK5GhRxqWOxVvY+Z4adW8 XHIdxU67p8mt4j5GjfD36DOyx4oXz7silULhEsRkot1BrxlRR6BxuJJLfO5uaD0GHU0i4Q v4eMKlbCoqcw7euzythpr+W07dk7Dek= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1690240551; 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=RaPsAZgv2K2/b+sXSYIrVCCFrSUdfQerUaqQeMt9zpI=; b=+4zKogHUNn+m+usOQ87v74S8mb76kWqu1edZHMpJ0eH5R8Y0YxQQwiEPOKyhpzhVQcujIg XlKLXylm71aAX1Bg== 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 84A4513476; Mon, 24 Jul 2023 23:15:48 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id dubYDCQGv2RfTgAAMHmgww (envelope-from ); Mon, 24 Jul 2023 23:15:48 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: "NeilBrown" To: "Jeff Layton" Cc: "Chuck Lever" , "Olga Kornievskaia" , "Dai Ngo" , "Tom Talpey" , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, "Jeff Layton" Subject: Re: [PATCH RFC] nfsd: set missing after_change as before_change + 1 In-reply-to: <20230724-bz2223560-v1-1-b6da868c0fc6@kernel.org> References: <20230724-bz2223560-v1-1-b6da868c0fc6@kernel.org> Date: Tue, 25 Jul 2023 09:15:43 +1000 Message-id: <169024054352.11078.14089484038867274825@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 Tue, 25 Jul 2023, Jeff Layton wrote: > 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. >=20 > 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. >=20 > Suggested-by: Neil Brown > Signed-off-by: Jeff Layton > --- > fs/nfsd/nfs4proc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > 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 =3D 0; > if (!fhp->fh_post_saved) > - cinfo->after_change =3D 0; > + cinfo->after_change =3D cinfo->before_change + 1; > } Thanks for this Jeff. Only problem is that the comment above this code is now even more wrong than it was before :-) I cannot convincingly argue that having the "+1" is better than not (as Chuck wondered about), but I think "0" is completely arbitrary, while ->before_change+1 is the sort of value we might reasonably expect. Thanks, NeilBrown > =20 > static __be32 >=20 > --- > base-commit: 97a5d0146ef443df148805a4e9c3c44111f14ab1 > change-id: 20230724-bz2223560-5ed6bc3a5db7 >=20 > Best regards, > --=20 > Jeff Layton >=20 >=20