From: Nagendra S Tomar Date: Tue, 16 Mar 2021 10:25:14 +0000 (+0000) Subject: nfs: Subsequent READDIR calls should carry non-zero cookieverifier X-Git-Tag: v5.11.22~198 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bdc9e552a3dc81864fcdc7de5aaa89d0703dd8f4;p=thirdparty%2Fkernel%2Fstable.git nfs: Subsequent READDIR calls should carry non-zero cookieverifier [ Upstream commit ee3707ae2c1f1327ad5188836b7ab62ed2c93b28 ] If the loop in nfs_readdir_xdr_to_array() runs more than once, subsequent READDIR RPCs may wrongly carry a zero cookie verifier and non-zero cookie. Make sure subsequent calls to READDIR carry the cookie verifier returned by the first call. Signed-off-by: Nagendra S Tomar Fixes: b593c09f83a2 ("NFS: Improve handling of directory verifiers") Signed-off-by: Trond Myklebust Signed-off-by: Sasha Levin --- diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 4db3018776f68..c3618b6abfc01 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -865,6 +865,8 @@ static int nfs_readdir_xdr_to_array(struct nfs_readdir_descriptor *desc, break; } + verf_arg = verf_res; + status = nfs_readdir_page_filler(desc, entry, pages, pglen, arrays, narrays); } while (!status && nfs_readdir_page_needs_filling(page));