summaryrefslogtreecommitdiffstats
path: root/sys/nfsserver/nfs_serv.c
diff options
context:
space:
mode:
authormpp <mpp@FreeBSD.org>2007-02-13 03:27:45 +0000
committermpp <mpp@FreeBSD.org>2007-02-13 03:27:45 +0000
commitf66eda706d12c8f02e4efab30080e02179d3c9a2 (patch)
treeb462984c9f818b37699dfa0b439924da98146d05 /sys/nfsserver/nfs_serv.c
parent919f31fdd077a9d1a9daf69c9d10b70ae8c9f8a0 (diff)
downloadFreeBSD-src-f66eda706d12c8f02e4efab30080e02179d3c9a2.zip
FreeBSD-src-f66eda706d12c8f02e4efab30080e02179d3c9a2.tar.gz
Get the vfs giant lock before calling nfs_access.
Reviewed by: mohan
Diffstat (limited to 'sys/nfsserver/nfs_serv.c')
-rw-r--r--sys/nfsserver/nfs_serv.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c
index 0e54d8a..9418672 100644
--- a/sys/nfsserver/nfs_serv.c
+++ b/sys/nfsserver/nfs_serv.c
@@ -435,9 +435,15 @@ nfsrv_setattr(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
if (vp->v_type == VDIR) {
error = EISDIR;
goto out;
- } else if ((error = nfsrv_access(vp, VWRITE, cred, rdonly,
- td, 0)) != 0)
- goto out;
+ } else {
+ vfslocked = VFS_LOCK_GIANT(vp->v_mount);
+ if ((error = nfsrv_access(vp, VWRITE, cred, rdonly,
+ td, 0)) != 0) {
+ VFS_UNLOCK_GIANT(vfslocked);
+ goto out;
+ }
+ VFS_UNLOCK_GIANT(vfslocked);
+ }
}
vfslocked = VFS_LOCK_GIANT(vp->v_mount);
error = VOP_SETATTR(vp, vap, cred, td);
OpenPOWER on IntegriCloud