Message ID | 24014d0e4f7119c76193eda5c5104a69bcaa30dd.1611160121.git.bcodding@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | NFS client readdir per-page validation | expand |
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index d6101e45fd66..7ca79d4b25ec 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -1284,6 +1284,8 @@ static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int whence) dir_ctx->pgc.index_cookie = offset; else dir_ctx->pgc.index_cookie = 0; + dir_ctx->pgc.page_index = 0; + dir_ctx->pgc.entry_index = 0; if (offset == 0) memset(dir_ctx->verf, 0, sizeof(dir_ctx->verf)); dir_ctx->duped = 0;
Unless we reset the cursor, a series of lseek() getdents() calls will continue filling the pagecache indefinitely. Instead, reset the cursor so that we always start filling at the beginning of the pagecache. Signed-off-by: Benjamin Coddington <bcodding@redhat.com> --- fs/nfs/dir.c | 2 ++ 1 file changed, 2 insertions(+)