summaryrefslogtreecommitdiffstats
path: root/sys/nfsserver
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2008-03-04 11:05:03 +0000
committerkib <kib@FreeBSD.org>2008-03-04 11:05:03 +0000
commit02dada141b69065d6a9fab37b630495e37673fc7 (patch)
treeff97574aedf6049b433eef947d4a351a4b055456 /sys/nfsserver
parent3f9aa32684a5e35476d656bc46c524f093b0c060 (diff)
downloadFreeBSD-src-02dada141b69065d6a9fab37b630495e37673fc7.zip
FreeBSD-src-02dada141b69065d6a9fab37b630495e37673fc7.tar.gz
Fix the Giant leak in the nfsrv_remove().
Reported by: pluknet <pluknet gmail com> MFC after: 1 week
Diffstat (limited to 'sys/nfsserver')
-rw-r--r--sys/nfsserver/nfs_serv.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c
index 4091c84..8f5b0d5 100644
--- a/sys/nfsserver/nfs_serv.c
+++ b/sys/nfsserver/nfs_serv.c
@@ -2146,7 +2146,7 @@ nfsrv_remove(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
nfsfh_t nfh;
fhandle_t *fhp;
struct mount *mp = NULL;
- int vfslocked;
+ int vfslocked, vfslocked1;
nfsdbprintf(("%s %d\n", __FILE__, __LINE__));
ndclear(&nd);
@@ -2168,7 +2168,11 @@ nfsrv_remove(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
nd.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF | MPSAFE;
error = nfs_namei(&nd, fhp, len, slp, nam, &md, &dpos,
&dirp, v3, &dirfor, &dirfor_ret, td, FALSE);
- vfslocked = NDHASGIANT(&nd);
+ vfslocked1 = NDHASGIANT(&nd);
+ if (vfslocked && vfslocked1)
+ VFS_UNLOCK_GIANT(vfslocked1);
+ if (vfslocked || vfslocked1)
+ vfslocked = 1;
if (dirp && !v3) {
vrele(dirp);
dirp = NULL;
OpenPOWER on IntegriCloud