From 7f2f2dae43714c083710ac1b31169e982e4f78a7 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Mon, 3 May 1999 20:59:14 +0000 Subject: [PATCH] All directory accesses must be made with NFS_DIRBLKSIZE chunks to avoid confusing the directory read cookie cache. The nfs_access implementation for v2 mounts attempts to read from the directory if root is the user so that root can't access cached files when the server remaps root to some other user. Submitted by: Doug Rabson Reviewed by: Matthew Dillon --- sys/nfs/nfs_vnops.c | 6 +++--- sys/nfsclient/nfs_vnops.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c index 6114d56f340..13514b8ef92 100644 --- a/sys/nfs/nfs_vnops.c +++ b/sys/nfs/nfs_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95 - * $Id: nfs_vnops.c,v 1.124 1999/03/12 02:24:58 julian Exp $ + * $Id: nfs_vnops.c,v 1.125 1999/05/02 23:56:26 alc Exp $ */ @@ -408,9 +408,9 @@ nfs_access(ap) error = nfs_readrpc(vp, &auio, ap->a_cred); else if (vp->v_type == VDIR) { char* bp; - bp = malloc(DIRBLKSIZ, M_TEMP, M_WAITOK); + bp = malloc(NFS_DIRBLKSIZ, M_TEMP, M_WAITOK); aiov.iov_base = bp; - aiov.iov_len = auio.uio_resid = DIRBLKSIZ; + aiov.iov_len = auio.uio_resid = NFS_DIRBLKSIZ; error = nfs_readdirrpc(vp, &auio, ap->a_cred); free(bp, M_TEMP); } else if (vp->v_type == VLNK) diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c index 6114d56f340..13514b8ef92 100644 --- a/sys/nfsclient/nfs_vnops.c +++ b/sys/nfsclient/nfs_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95 - * $Id: nfs_vnops.c,v 1.124 1999/03/12 02:24:58 julian Exp $ + * $Id: nfs_vnops.c,v 1.125 1999/05/02 23:56:26 alc Exp $ */ @@ -408,9 +408,9 @@ nfs_access(ap) error = nfs_readrpc(vp, &auio, ap->a_cred); else if (vp->v_type == VDIR) { char* bp; - bp = malloc(DIRBLKSIZ, M_TEMP, M_WAITOK); + bp = malloc(NFS_DIRBLKSIZ, M_TEMP, M_WAITOK); aiov.iov_base = bp; - aiov.iov_len = auio.uio_resid = DIRBLKSIZ; + aiov.iov_len = auio.uio_resid = NFS_DIRBLKSIZ; error = nfs_readdirrpc(vp, &auio, ap->a_cred); free(bp, M_TEMP); } else if (vp->v_type == VLNK) -- 2.45.2