summaryrefslogtreecommitdiffstats
path: root/sys/nfsserver/nfs_serv.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2006-03-31 03:54:20 +0000
committerjeff <jeff@FreeBSD.org>2006-03-31 03:54:20 +0000
commit32b1878006f50d14c52851c90a362f1012c69f43 (patch)
treedb33a736e9b94a3a4157303b09a71a143008ad95 /sys/nfsserver/nfs_serv.c
parentb9e82e7feff34d930f11589e465848e6fe444742 (diff)
downloadFreeBSD-src-32b1878006f50d14c52851c90a362f1012c69f43.zip
FreeBSD-src-32b1878006f50d14c52851c90a362f1012c69f43.tar.gz
- Release the references acquired by VOP_GETWRITEMOUNT and vfs_getvfs().
Discussed with: tegge Tested by: kris Sponsored by: Isilon Systems, Inc.
Diffstat (limited to 'sys/nfsserver/nfs_serv.c')
-rw-r--r--sys/nfsserver/nfs_serv.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c
index f7597e4..3b8285f 100644
--- a/sys/nfsserver/nfs_serv.c
+++ b/sys/nfsserver/nfs_serv.c
@@ -338,6 +338,7 @@ nfsrv_setattr(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
NFSD_UNLOCK();
mtx_lock(&Giant); /* VFS */
(void) vn_start_write(NULL, &mp, V_WAIT);
+ vfs_rel(mp); /* The write holds a ref. */
mtx_unlock(&Giant); /* VFS */
NFSD_LOCK();
VATTR_NULL(vap);
@@ -1103,6 +1104,7 @@ nfsrv_write(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
NFSD_UNLOCK();
mtx_lock(&Giant); /* VFS */
(void) vn_start_write(NULL, &mntp, V_WAIT);
+ vfs_rel(mntp); /* The write holds a ref. */
mtx_unlock(&Giant); /* VFS */
NFSD_LOCK();
if (v3) {
@@ -1754,6 +1756,7 @@ nfsrv_create(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
NFSD_UNLOCK();
mtx_lock(&Giant); /* VFS */
(void) vn_start_write(NULL, &mp, V_WAIT);
+ vfs_rel(mp); /* The write holds a ref. */
mtx_unlock(&Giant); /* VFS */
NFSD_LOCK();
nfsm_srvnamesiz(len);
@@ -2058,6 +2061,7 @@ nfsrv_mknod(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
NFSD_UNLOCK();
mtx_lock(&Giant); /* VFS */
(void) vn_start_write(NULL, &mp, V_WAIT);
+ vfs_rel(mp); /* The write holds a ref. */
mtx_unlock(&Giant); /* VFS */
NFSD_LOCK();
nfsm_srvnamesiz(len);
@@ -2260,6 +2264,7 @@ nfsrv_remove(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
NFSD_UNLOCK();
mtx_lock(&Giant); /* VFS */
(void) vn_start_write(NULL, &mp, V_WAIT);
+ vfs_rel(mp); /* The write holds a ref. */
mtx_unlock(&Giant); /* VFS */
NFSD_LOCK();
nfsm_srvnamesiz(len);
@@ -2394,6 +2399,7 @@ nfsrv_rename(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
NFSD_UNLOCK();
mtx_lock(&Giant);
(void) vn_start_write(NULL, &mp, V_WAIT);
+ vfs_rel(mp); /* The write holds a ref. */
mtx_unlock(&Giant);
NFSD_LOCK();
nfsm_srvnamesiz(len);
@@ -2637,6 +2643,7 @@ nfsrv_link(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
NFSD_UNLOCK();
mtx_lock(&Giant); /* VFS */
(void) vn_start_write(NULL, &mp, V_WAIT);
+ vfs_rel(mp); /* The write holds a ref. */
mtx_unlock(&Giant); /* VFS */
NFSD_LOCK();
nfsm_srvmtofh(dfhp);
@@ -2801,6 +2808,7 @@ nfsrv_symlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
NFSD_UNLOCK();
mtx_lock(&Giant); /* VFS */
(void) vn_start_write(NULL, &mp, V_WAIT);
+ vfs_rel(mp); /* The write holds a ref. */
mtx_unlock(&Giant); /* VFS */
NFSD_LOCK();
nfsm_srvnamesiz(len);
@@ -2991,6 +2999,7 @@ nfsrv_mkdir(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
NFSD_UNLOCK();
mtx_lock(&Giant); /* VFS */
(void) vn_start_write(NULL, &mp, V_WAIT);
+ vfs_rel(mp); /* The write holds a ref. */
mtx_unlock(&Giant); /* VFS */
NFSD_LOCK();
nfsm_srvnamesiz(len);
@@ -3164,6 +3173,7 @@ nfsrv_rmdir(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
NFSD_UNLOCK();
mtx_lock(&Giant); /* VFS */
(void) vn_start_write(NULL, &mp, V_WAIT);
+ vfs_rel(mp); /* The write holds a ref. */
mtx_unlock(&Giant); /* VFS */
NFSD_LOCK();
nfsm_srvnamesiz(len);
@@ -4024,6 +4034,7 @@ nfsrv_commit(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
NFSD_UNLOCK();
mtx_lock(&Giant); /* VFS */
(void) vn_start_write(NULL, &mp, V_WAIT);
+ vfs_rel(mp); /* The write holds a ref. */
mtx_unlock(&Giant); /* VFS */
NFSD_LOCK();
tl = nfsm_dissect_nonblock(u_int32_t *, 3 * NFSX_UNSIGNED);
OpenPOWER on IntegriCloud