diff options
author | rmacklem <rmacklem@FreeBSD.org> | 2011-01-05 18:46:05 +0000 |
---|---|---|
committer | rmacklem <rmacklem@FreeBSD.org> | 2011-01-05 18:46:05 +0000 |
commit | 10ecdb0a36cd6aed8cab1cb8cd5b613ce76fa346 (patch) | |
tree | 8282ccc73eb1d19dba66e58e08b5e0709dc21518 /sys/fs | |
parent | fbe08846765ee2924ee41c57b1ea51f5bba68c7a (diff) | |
download | FreeBSD-src-10ecdb0a36cd6aed8cab1cb8cd5b613ce76fa346.zip FreeBSD-src-10ecdb0a36cd6aed8cab1cb8cd5b613ce76fa346.tar.gz |
Fix the experimental NFS server to use vfs_busyfs() instead
of vfs_getvfs() so that the mount point is busied for the
VFS_FHTOVP() call. This is analagous to r185432 for the
regular NFS server.
Reviewed by: kib
MFC after: 12 days
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/nfsserver/nfs_nfsdport.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 1bd7e1c..8201efc 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -2548,8 +2548,8 @@ nfsd_fhtovp(struct nfsrv_descript *nd, struct nfsrvfh *nfp, int lktype, /* * Check for the special case of the nfsv4root_fh. */ - mp = vfs_getvfs(&fhp->fh_fsid); - if (!mp) { + mp = vfs_busyfs(&fhp->fh_fsid); + if (mp == NULL) { *vpp = NULL; nd->nd_repstat = ESTALE; if (*mpp && exp->nes_vfslocked) @@ -2575,6 +2575,7 @@ nfsd_fhtovp(struct nfsrv_descript *nd, struct nfsrvfh *nfp, int lktype, nd->nd_repstat = nfsvno_fhtovp(mp, fhp, nd->nd_nam, lktype, vpp, exp, &credanon); + vfs_unbusy(mp); /* * For NFSv4 without a pseudo root fs, unexported file handles @@ -2636,11 +2637,8 @@ nfsd_fhtovp(struct nfsrv_descript *nd, struct nfsrvfh *nfp, int lktype, VFS_UNLOCK_GIANT(mp); exp->nes_vfslocked = 0; } - vfs_rel(mp); *vpp = NULL; *mpp = NULL; - } else { - vfs_rel(mp); } } @@ -2780,10 +2778,11 @@ nfsvno_getvp(fhandle_t *fhp) struct vnode *vp; int error; - mp = vfs_getvfs(&fhp->fh_fsid); + mp = vfs_busyfs(&fhp->fh_fsid); if (mp == NULL) return (NULL); error = VFS_FHTOVP(mp, &fhp->fh_fid, &vp); + vfs_unbusy(mp); if (error) return (NULL); return (vp); |