From: Jeff Layton Date: Mon, 24 Jul 2023 14:53:39 +0000 (-0400) Subject: nfsd: set missing after_change as before_change + 1 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=f2b7019d2e3c4f1f55be658659804b337dcfac60;p=linux.git nfsd: set missing after_change as before_change + 1 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 Signed-off-by: Chuck Lever --- diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index a9c84339ff659..7588fd1859a4f 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