If we're going through the loop in nfs_readdir() more than once, we usually
do not want to restart searching from the beginning of the pages cache.
We only want to do that if the previous search failed...
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
int readdir_search_pagecache(nfs_readdir_descriptor_t *desc)
{
int res = -EAGAIN;
- desc->page_index = 0;
-
- if (*desc->dir_cookie == 0)
- desc->cache_entry_index = 0;
while (1) {
res = find_cache_page(desc);
goto out_release;
}
+ desc->page_index = 0;
desc->page = page;
status = nfs_do_filldir(desc, dirent, filldir);
if (res == -ETOOSMALL && desc->plus) {
clear_bit(NFS_INO_ADVISE_RDPLUS, &NFS_I(inode)->flags);
nfs_zap_caches(inode);
+ desc->page_index = 0;
desc->plus = 0;
desc->eof = 0;
continue;