From 8361de2544e490a7b3cd33c033edccce008287af Mon Sep 17 00:00:00 2001 From: Rick Macklem Date: Wed, 11 Jul 2018 23:23:29 +0000 Subject: [PATCH] Ignore the cookie verifier for NFSv4.1 when the cookie is 0. RFC5661 states that the cookie verifier should be 0 when the cookie is 0. However, the wording is somewhat unclear and a recent discussion on the nfsv4@ietf.org mailing list indicated that the NFSv4 server should ignore the cookie verifier's value when the dirctory offset cookie is 0. This patch deletes the check for this that would return NFSERR_BAD_COOKIE when the verifier was not 0. This was found during testing of the ESXi client against the NFSv4.1 server. Reported by: daniel@ftml.net (via packet trace) MFC after: 2 weeks --- sys/fs/nfsserver/nfs_nfsdport.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 02cf3e04a1f..9916f5c328d 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -2101,6 +2101,7 @@ nfsrvd_readdirplus(struct nfsrv_descript *nd, int isdgram, } fullsiz = siz; nd->nd_repstat = getret = nfsvno_getattr(vp, &at, nd, p, 1, NULL); +#if 0 if (!nd->nd_repstat) { if (off && verf != at.na_filerev) { /* @@ -2109,17 +2110,14 @@ nfsrvd_readdirplus(struct nfsrv_descript *nd, int isdgram, * removed/added unless that offset cookies returned to * the client are no longer valid. */ -#if 0 if (nd->nd_flag & ND_NFSV4) { nd->nd_repstat = NFSERR_NOTSAME; } else { nd->nd_repstat = NFSERR_BAD_COOKIE; } -#endif - } else if ((nd->nd_flag & ND_NFSV4) && off == 0 && verf != 0) { - nd->nd_repstat = NFSERR_BAD_COOKIE; } } +#endif if (!nd->nd_repstat && vp->v_type != VDIR) nd->nd_repstat = NFSERR_NOTDIR; if (!nd->nd_repstat && cnt == 0)