Since there's no longer a significant performance penalty for dropping the pagecache, and because we want to ensure that the directory's change attribute is accurate before validating pagecache pages, revalidate the directory's mapping on every call to nfs_readdir(). Signed-off-by: Benjamin Coddington <bcodding@xxxxxxxxxx> --- fs/nfs/dir.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index fc9e72341220..842412454e3d 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -1167,11 +1167,9 @@ static int nfs_readdir(struct file *file, struct dir_context *ctx) * to either find the entry with the appropriate number or * revalidate the cookie. */ - if (ctx->pos == 0 || nfs_attribute_cache_expired(inode)) { - res = nfs_revalidate_mapping(inode, file->f_mapping); - if (res < 0) - goto out; - } + res = nfs_revalidate_mapping(inode, file->f_mapping); + if (res < 0) + goto out; res = -ENOMEM; desc = kzalloc(sizeof(*desc), GFP_KERNEL); -- 2.25.4