提交 f892c41c 编写于 作者: T Trond Myklebust

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: b593c09f ("NFS: Improve handling of directory verifiers")
Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
上级 13884ff2
......@@ -929,7 +929,12 @@ static int find_and_lock_cache_page(struct nfs_readdir_descriptor *desc)
}
return res;
}
memcpy(nfsi->cookieverf, verf, sizeof(nfsi->cookieverf));
/*
* Set the cookie verifier if the page cache was empty
*/
if (desc->page_index == 0)
memcpy(nfsi->cookieverf, verf,
sizeof(nfsi->cookieverf));
}
res = nfs_readdir_search_array(desc);
if (res == 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册