summaryrefslogtreecommitdiffstats
path: root/sys/nfs/nfs_serv.c
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>1995-08-03 12:14:16 +0000
committerdfr <dfr@FreeBSD.org>1995-08-03 12:14:16 +0000
commit5c52c134bf2652fb2ae7ba3735fc75695080ae0b (patch)
tree8d651d8149b59fd3af39469afe26ad28eec59e10 /sys/nfs/nfs_serv.c
parent08830e41cb100de7d94e6d141b8e25a5a9f8ebcf (diff)
downloadFreeBSD-src-5c52c134bf2652fb2ae7ba3735fc75695080ae0b.zip
FreeBSD-src-5c52c134bf2652fb2ae7ba3735fc75695080ae0b.tar.gz
Slight changes to locking around VOP_READRIR.
Detect in nfsrv_readdirplus when a filesystem soes not support VFS_VGET and return NFSERR_NOTSUPP so that the client will use ordinary readdir instead.
Diffstat (limited to 'sys/nfs/nfs_serv.c')
-rw-r--r--sys/nfs/nfs_serv.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c
index dfdd797..2b6ebde 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.19 1995/08/01 18:50:57 davidg Exp $
+ * $Id: nfs_serv.c,v 1.20 1995/08/02 10:12:47 dfr Exp $
*/
/*
@@ -2553,7 +2553,6 @@ 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;
@@ -2562,6 +2561,7 @@ again:
if (!error)
error = getret;
}
+ VOP_UNLOCK(vp);
if (error) {
nfsrv_vrele(vp);
free((caddr_t)rbuf, M_TEMP);
@@ -2810,6 +2810,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);
@@ -2821,6 +2822,7 @@ again:
#endif
off = (u_quad_t)io.uio_offset;
getret = VOP_GETATTR(vp, &at, cred, procp);
+ VOP_UNLOCK(vp);
if (!cookies && !error)
error = NFSERR_PERM;
if (!error)
@@ -2889,6 +2891,20 @@ again:
goto again;
}
+ /*
+ * Probe one of the directory entries to see if the filesystem
+ * supports VGET.
+ */
+ if (VFS_VGET(vp->v_mount, dp->d_fileno, &nvp) == EOPNOTSUPP) {
+ error = NFSERR_NOTSUPP;
+ nfsrv_vrele(vp);
+ free((caddr_t)cookies, M_TEMP);
+ free((caddr_t)rbuf, M_TEMP);
+ nfsm_reply(NFSX_V3POSTOPATTR);
+ nfsm_srvpostop_attr(getret, &at);
+ return (0);
+ }
+
dirlen = len = NFSX_V3POSTOPATTR + NFSX_V3COOKIEVERF + 2 * NFSX_UNSIGNED;
nfsm_reply(cnt);
nfsm_srvpostop_attr(getret, &at);
OpenPOWER on IntegriCloud