From f4c1ee96e5195b3199b9bc9792f764abd34c7cf7 Mon Sep 17 00:00:00 2001 From: Kinglong Mee Date: Fri, 13 Jun 2014 17:32:42 +0800 Subject: [PATCH] NFSD: fix bug for readdir of pseudofs Commit 439eb4cf42e1 (nfsd4: allow large readdirs) introduces a bug about readdir the root of pseudofs. Call xdr_truncate_encode() revert encoded name when skipping. Signed-off-by: Kinglong Mee Signed-off-by: J. Bruce Fields --- fs/nfsd/nfs4xdr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 2d305a121f379..83baf2bfe9e9c 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -2687,6 +2687,7 @@ nfsd4_encode_dirent(void *ccdv, const char *name, int namlen, nfserr = nfserr_toosmall; goto fail; case nfserr_noent: + xdr_truncate_encode(xdr, start_offset); goto skip_entry; default: /* -- 2.39.5