NFS: Don't skip directory entries when doing uncached readdir
authortrondmy@kernel.org <trondmy@kernel.org>
Wed, 19 Jan 2022 00:52:16 +0000 (19:52 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Feb 2022 11:56:24 +0000 (12:56 +0100)
[ Upstream commit ce292d8faf41f62e0fb0c78476c6fce5d629235a ]

Ensure that we initialise desc->cache_entry_index correctly in
uncached_readdir().

Fixes: d1bacf9eb2fd ("NFS: add readdir cache array")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/dir.c

index af7881bc6b3e6d53397ff025e1dcf772f90b877b..f6381c675cbe9ac0886fc213d6186daae93d312d 100644 (file)
@@ -1049,6 +1049,7 @@ static int uncached_readdir(struct nfs_readdir_descriptor *desc)
                goto out;
 
        desc->page_index = 0;
+       desc->cache_entry_index = 0;
        desc->last_cookie = desc->dir_cookie;
        desc->duped = 0;