nfsd: fix handling of delegated change attr in CB_GETATTR
authorJeff Layton <jlayton@kernel.org>
Mon, 9 Dec 2024 21:13:53 +0000 (16:13 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Tue, 21 Jan 2025 20:29:40 +0000 (15:29 -0500)
commit531503054e8fe9f4502fff0dceba20dfaa9920d5
treed5640e52fde041be2602aa008e77202a061e8a95
parent1196bdce3d107194dd15f508602871ffb7ff2d0b
nfsd: fix handling of delegated change attr in CB_GETATTR

RFC8881, section 10.4.3 has some specific guidance as to how the
delegated change attribute should be handled. We currently don't follow
that guidance properly.

In particular, when the file is modified, the server always reports the
initial change attribute + 1. Section 10.4.3 however indicates that it
should be incremented on every GETATTR request from other clients.

Only request the change attribute until the file has been modified. If
there is an outstanding delegation, then increment the cached change
attribute on every GETATTR.

Fixes: 6487a13b5c6b ("NFSD: add support for CB_GETATTR callback")
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4callback.c
fs/nfsd/nfs4xdr.c