Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp3339091rwo; Mon, 24 Jul 2023 09:31:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlHEQXa66Sg9/x30D5mylzxueUtKgozhW9Uf/biXVxEKpHd+RbZ9HyVB/nXM9V2o0lhVq5gP X-Received: by 2002:ac2:5e71:0:b0:4fb:745e:dd01 with SMTP id a17-20020ac25e71000000b004fb745edd01mr5230818lfr.45.1690216304536; Mon, 24 Jul 2023 09:31:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690216304; cv=none; d=google.com; s=arc-20160816; b=POBmXdS8ZoXjhkMooNpnVaeR1FcRgQcMIreVNbrWBAIFinEiKIM/9MzYc7zPMSFX3a V20jtCJRJETj2Q52TXXel3G7eyF9Tr2KM0vDV+ri2rJX0bEIRnaZ1IiZvT4RkpO2b1eJ mDr0WWmmJ7xLQAhjAnH9Fl1J3ZWx/V1zD0v6sY2D3tiru03w5D4KgIf6sixZRaihONiC sMVqVbdwAnxICoKo4crxIL4l3xvGbb1lKuWe3oUzBvni/cv/3a8u7B7Tx/FPDj+V3hlU V/kkQvcWZVauyaLG66Hi3QAwMec79DOY1hZIM+8n7JlvNkT7mIcB7AYT94aBEvL55s8I urFQ== 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=78UjWE8/xiEMRIJRG/YOp75Wgfqmr/GANBezV7USop8=; fh=5OIlxBQLGvc/nIgZZURVFlxJ3YOUrF94Q6fyrr8fJOg=; b=MyFB7JHoC3WwHxujF4Z9vP+Gnl+udOiNMwkCvHiZXa8MKoyKK6xWhiuy/tCLlyy1U/ bH/TertjxZM41z8HHkuWrwf5GqLVx6gxWXNgEw5REpqNTmHsE55PNvo0NfmT0HRExb+I V28IKvTEMr61djjfVfpFvpkYsDhN3EBmqyFiCoHqH6KGn0cXaNixc1BoM2wzs8sbr3nC B9k+de1gmLu+DM7ahYoXXHM5dwbVgv95H5Nxg4FlsxmuItQMwoop2k9qbQz2my0hTaMJ DW9nQCxoeQMxkbx8l4i4bGhU6n1pb9BfNBLOnpo8mRuE59cEkr8wf/j79L33N+6gxI31 qp2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nJejhWMV; 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 u15-20020a05640207cf00b00522278e90cesi2523295edy.310.2023.07.24.09.31.11; Mon, 24 Jul 2023 09:31:44 -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=nJejhWMV; 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 S229481AbjGXQVv (ORCPT + 99 others); Mon, 24 Jul 2023 12:21:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229478AbjGXQVv (ORCPT ); Mon, 24 Jul 2023 12:21:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B13510C8; Mon, 24 Jul 2023 09:21:50 -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 9CE0261200; Mon, 24 Jul 2023 16:21:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5EEA6C433C8; Mon, 24 Jul 2023 16:21:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690215709; bh=ofINXhEcixn1JUJZkatETIjZs/9QKdfI2nw3ECBI5ic=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=nJejhWMVSUw1u5v6oOCzA4VvuG89LWLkJVKCrPlQdrxG+nPAoPQEctFYYnpGKteBo XwdWhMWIA47s9u+GHCZgkzpL8dpEQKyZG3t3/UVr3hLyDp/9SUxprLShQBWUuEf5Fw ByS1ZDokQ70L75mD+gE9vY/Orf1qT12A0Gt8WRc4r68nwIn2l1Pq2sxYsM2DrwqXct s8+iIpYi7Cs0ZNbeUEAi4WoNVpFNFM+Cr1N+yeiAqjj2DnaFlH6dmIck6IvKOhL2CK kM5ri7y3XV7YnXo6EQeNQjuABVRC4GhUPPxKeNsNGYZd6GP2Ih+kZORDqFsCGDaeTS iR62zWP0SaAhA== Message-ID: <969a2ddc66df3ba05952fb14352ccee08bd84149.camel@kernel.org> Subject: Re: [PATCH RFC] nfsd: set missing after_change as before_change + 1 From: Jeff Layton To: Chuck Lever Cc: Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 24 Jul 2023 12:21:47 -0400 In-Reply-To: References: <20230724-bz2223560-v1-1-b6da868c0fc6@kernel.org> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 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 Mon, 2023-07-24 at 11:20 -0400, Chuck Lever wrote: > On Mon, Jul 24, 2023 at 10:53:39AM -0400, 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 > I'm not sure this change makes any difference. The client would > possibly see the change value move forward then back. I'd think a > false "atomic" field and using the /same/ pre- and post-change would > be safer...? >=20 > But I'm intrigued enough to apply this to nfsd-next provisionally, > at least for testing and further review. It will appear a little > later today. >=20 >=20 Thanks. I think there really are no great choices here. This is a rather unlikely error case that should only come into play when there are problems with the underlying filesystem, but only when fetching the post-op attrs. We don't have a way to just opt out of providing a post-op attribute and I think this is probably the least bad option of what to put in there. > > 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, st= ruct 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; > > } > > =20 > > static __be32 > >=20 > > --- > > base-commit: 97a5d0146ef443df148805a4e9c3c44111f14ab1 > > change-id: 20230724-bz2223560-5ed6bc3a5db7 > >=20 > > Best regards, > > --=20 > > Jeff Layton > >=20 >=20 --=20 Jeff Layton