aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pritchard <mpp@FreeBSD.org>2007-02-13 03:27:45 +0000
committerMike Pritchard <mpp@FreeBSD.org>2007-02-13 03:27:45 +0000
commit5cb6b1effbdd634b40df6b7810a936a50aa19c33 (patch)
treeb462984c9f818b37699dfa0b439924da98146d05
parent55fd006cc8f9ae0c3e459d66450b51462d74a588 (diff)
downloadsrc-5cb6b1effbdd634b40df6b7810a936a50aa19c33.tar.gz
src-5cb6b1effbdd634b40df6b7810a936a50aa19c33.zip
Get the vfs giant lock before calling nfs_access.
Reviewed by: mohan
Notes
Notes: svn path=/head/; revision=166683
-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 0e54d8ae1880..94186720d027 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);