diff options
author | dfr <dfr@FreeBSD.org> | 1995-08-02 10:12:47 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 1995-08-02 10:12:47 +0000 |
commit | 3005a2c5a8183ac588dab70a3deadb1d2a6fb068 (patch) | |
tree | 95d23f0f6c45ca3b3dfc03f1282a48f9b1ed35a8 /sys | |
parent | 6c6079a3a0c3fb2088b7d61a4abfc3c9a4a01500 (diff) | |
download | FreeBSD-src-3005a2c5a8183ac588dab70a3deadb1d2a6fb068.zip FreeBSD-src-3005a2c5a8183ac588dab70a3deadb1d2a6fb068.tar.gz |
Lock the directory vnode before VOP_READDIR in nfsrv_readdirplus
Diffstat (limited to 'sys')
-rw-r--r-- | sys/nfs/nfs_serv.c | 4 | ||||
-rw-r--r-- | sys/nfsserver/nfs_serv.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c index 8330da6..dfdd797 100644 --- a/sys/nfs/nfs_serv.c +++ b/sys/nfs/nfs_serv.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_serv.c 8.3 (Berkeley) 1/12/94 - * $Id: nfs_serv.c,v 1.18 1995/06/28 12:01:03 davidg Exp $ + * $Id: nfs_serv.c,v 1.19 1995/08/01 18:50:57 davidg Exp $ */ /* @@ -2543,6 +2543,7 @@ again: io.uio_rw = UIO_READ; io.uio_procp = (struct proc *)0; eofflag = 0; + VOP_LOCK(vp); #ifndef __NetBSD__ if (cookies) { free((caddr_t)cookies, M_TEMP); @@ -2552,6 +2553,7 @@ again: #else error = VOP_READDIR(vp, &io, cred, &eofflag, cookies, ncookies); #endif + VOP_UNLOCK(vp); off = (off_t)io.uio_offset; if (!cookies && !error) error = NFSERR_PERM; diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c index 8330da6..dfdd797 100644 --- a/sys/nfsserver/nfs_serv.c +++ b/sys/nfsserver/nfs_serv.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_serv.c 8.3 (Berkeley) 1/12/94 - * $Id: nfs_serv.c,v 1.18 1995/06/28 12:01:03 davidg Exp $ + * $Id: nfs_serv.c,v 1.19 1995/08/01 18:50:57 davidg Exp $ */ /* @@ -2543,6 +2543,7 @@ again: io.uio_rw = UIO_READ; io.uio_procp = (struct proc *)0; eofflag = 0; + VOP_LOCK(vp); #ifndef __NetBSD__ if (cookies) { free((caddr_t)cookies, M_TEMP); @@ -2552,6 +2553,7 @@ again: #else error = VOP_READDIR(vp, &io, cred, &eofflag, cookies, ncookies); #endif + VOP_UNLOCK(vp); off = (off_t)io.uio_offset; if (!cookies && !error) error = NFSERR_PERM; |