Message ID | 20220227231227.9038-12-trondmy@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Readdir improvements | expand |
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index ca71271b5c62..eaf8d5cddb0f 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -990,9 +990,14 @@ static int find_and_lock_cache_page(struct nfs_readdir_descriptor *desc) /* * Set the cookie verifier if the page cache was empty */ - if (desc->page_index == 0) + if (desc->last_cookie == 0 && + memcmp(nfsi->cookieverf, verf, sizeof(nfsi->cookieverf))) { memcpy(nfsi->cookieverf, verf, sizeof(nfsi->cookieverf)); + invalidate_inode_pages2_range(desc->file->f_mapping, + desc->page_index_max + 1, + -1); + } } res = nfs_readdir_search_array(desc); if (res == 0)