From 9f5349f23db7d9ab5417bc173fd0d4e9f8400c65 Mon Sep 17 00:00:00 2001 From: Chuck Lever Date: Wed, 8 Mar 2006 01:43:01 +0000 Subject: [PATCH] Fix a bug in NFSv3 READDIRPLUS reply processing The client's READDIRPLUS logic skips the attributes and filehandle of the ".." entry. If the server doesn't send attributes but does send a filehandle for "..", the client's logic doesn't account for the extra "value follows" field that indicates whether the filehandle is present, causing the remaining entries in the reply to be ignored. Sponsored by: Network Appliance, Inc. Reviewed by: rick, mohans Approved by: silby MFC after: 2 weeks --- sys/nfsclient/nfs_vnops.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c index 445030d92b99..70288364b58f 100644 --- a/sys/nfsclient/nfs_vnops.c +++ b/sys/nfsclient/nfs_vnops.c @@ -2312,7 +2312,11 @@ nfs_readdirplusrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred) /* Just skip over the file handle */ tl = nfsm_dissect(u_int32_t *, NFSX_UNSIGNED); i = fxdr_unsigned(int, *tl); - nfsm_adv(nfsm_rndup(i)); + if (i) { + tl = nfsm_dissect(u_int32_t *, NFSX_UNSIGNED); + fhsize = fxdr_unsigned(int, *tl); + nfsm_adv(nfsm_rndup(fhsize)); + } } if (newvp != NULLVP) { if (newvp == vp)