[PATCH 5.16 111/203] NFS: Dont skip directory entries when doing uncached readdir
From: Greg Kroah-Hartman
Date: Mon Feb 14 2022 - 05:34:52 EST
From: trondmy@xxxxxxxxxx <trondmy@xxxxxxxxxx>
[ 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@xxxxxxxxxxxxxxx>
Signed-off-by: Anna Schumaker <Anna.Schumaker@xxxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
fs/nfs/dir.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 13740f1e3972e..63d7da0b7e32c 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1041,6 +1041,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;
--
2.34.1