NFS: Only change the cookie verifier if the directory page cache is empty
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 17 Mar 2021 12:46:19 +0000 (08:46 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 5 Apr 2021 13:04:20 +0000 (09:04 -0400)
commitf892c41c14e0fa3d78ce37de1d5c8161ed13bf08
tree62c539f90f96fef4a27574b39e975890c231046b
parent13884ff2bef01df37c450c6dd09122f92333dccc
NFS: Only change the cookie verifier if the directory page cache is empty

The cached NFSv3/v4 readdir cookies are associated with a verifier,
which is checked by the server on subsequent calls to readdir, and is
only expected to change when the cookies (and hence also the page cache
contents) are considered invalid.
We therefore do have to store the verifier, but only when the page cache
is empty.

Fixes: b593c09f83a2 ("NFS: Improve handling of directory verifiers")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/dir.c