Make FreeBSD less conservative in determining when to return a cookie

error for a directory.  I have made this change after a great deal of
    review although I cannot be absolutely sure that this meets the spec.

    The issue devolves into whether changes in an underlying (UFS) directory
    can cause NFS directory blocks to be renumbered.  My read of the code
    indicates that NFS directory blocks will not be renumbered, which means
    that the cookies should still remain valid after a change is made to
    the underlying directory.  This being the case, a cookie error should
    not be returned when a change is made to the underlying directory and,
    instead, the NFS client should rely on mtime detection to invalidate and
    reload the directory.

    The use of mtime is problematic in of itself, due to insufficient
    resolution, which is why I believe the original conservative error
    handling was done.  Still, there have been dozens of bug reports by
    people needing solaris<->FreeBSD interoperability and these have to
    be accomodated.
This commit is contained in:
Matthew Dillon 1999-09-29 17:14:58 +00:00
parent cc4a02e299
commit 13e14363fe
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=51796
2 changed files with 8 additions and 0 deletions

View File

@ -3032,11 +3032,13 @@ nfsrv_readdir(nfsd, slp, procp, mrq)
nqsrv_getl(vp, ND_READ);
if (v3) {
error = getret = VOP_GETATTR(vp, &at, cred, procp);
#if 0
/*
* XXX This check may be too strict for Solaris 2.5 clients.
*/
if (!error && toff && verf && verf != at.va_filerev)
error = NFSERR_BAD_COOKIE;
#endif
}
if (!error)
error = nfsrv_access(vp, VEXEC, cred, rdonly, procp, 0);
@ -3312,11 +3314,13 @@ nfsrv_readdirplus(nfsd, slp, procp, mrq)
goto nfsmout;
}
error = getret = VOP_GETATTR(vp, &at, cred, procp);
#if 0
/*
* XXX This check may be too strict for Solaris 2.5 clients.
*/
if (!error && toff && verf && verf != at.va_filerev)
error = NFSERR_BAD_COOKIE;
#endif
if (!error) {
nqsrv_getl(vp, ND_READ);
error = nfsrv_access(vp, VEXEC, cred, rdonly, procp, 0);

View File

@ -3032,11 +3032,13 @@ nfsrv_readdir(nfsd, slp, procp, mrq)
nqsrv_getl(vp, ND_READ);
if (v3) {
error = getret = VOP_GETATTR(vp, &at, cred, procp);
#if 0
/*
* XXX This check may be too strict for Solaris 2.5 clients.
*/
if (!error && toff && verf && verf != at.va_filerev)
error = NFSERR_BAD_COOKIE;
#endif
}
if (!error)
error = nfsrv_access(vp, VEXEC, cred, rdonly, procp, 0);
@ -3312,11 +3314,13 @@ nfsrv_readdirplus(nfsd, slp, procp, mrq)
goto nfsmout;
}
error = getret = VOP_GETATTR(vp, &at, cred, procp);
#if 0
/*
* XXX This check may be too strict for Solaris 2.5 clients.
*/
if (!error && toff && verf && verf != at.va_filerev)
error = NFSERR_BAD_COOKIE;
#endif
if (!error) {
nqsrv_getl(vp, ND_READ);
error = nfsrv_access(vp, VEXEC, cred, rdonly, procp, 0);