Temporary workaround to prevent leak of Giant from nfsd when calling
lookup(). Reviewed by: tegge Tested by: "Arno J. Klaassen" <arno at heho snv jussieu fr>, "Rong-en Fan" <grafan at gmail com>, Dmitriy Kirhlarov <dimma at higis ru>, Dmitry Pryanishnikov <dmitry at atlantis dp ua> MFC after: 1 week Approved by: kan, pjd (mentors)
This commit is contained in:
parent
c62502d1f6
commit
273147358f
@ -570,6 +570,10 @@ nfsrv_lookup(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
||||
|
||||
error = lookup(&ind);
|
||||
ind.ni_dvp = NULL;
|
||||
if (ind.ni_cnd.cn_flags & GIANTHELD) {
|
||||
mtx_unlock(&Giant);
|
||||
ind.ni_cnd.cn_flags &= ~GIANTHELD;
|
||||
}
|
||||
|
||||
if (error == 0) {
|
||||
/*
|
||||
@ -1918,6 +1922,10 @@ nfsrv_create(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
||||
|
||||
error = lookup(&nd);
|
||||
nd.ni_dvp = NULL;
|
||||
if (nd.ni_cnd.cn_flags & GIANTHELD) {
|
||||
mtx_unlock(&Giant);
|
||||
nd.ni_cnd.cn_flags &= ~GIANTHELD;
|
||||
}
|
||||
if (error)
|
||||
goto ereply;
|
||||
|
||||
@ -2145,6 +2153,10 @@ nfsrv_mknod(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
||||
|
||||
error = lookup(&nd);
|
||||
nd.ni_dvp = NULL;
|
||||
if (nd.ni_cnd.cn_flags & GIANTHELD) {
|
||||
mtx_unlock(&Giant);
|
||||
nd.ni_cnd.cn_flags &= ~GIANTHELD;
|
||||
}
|
||||
|
||||
if (error)
|
||||
goto out;
|
||||
@ -2886,6 +2898,10 @@ nfsrv_symlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
||||
|
||||
error = lookup(&nd);
|
||||
nd.ni_dvp = NULL;
|
||||
if (nd.ni_cnd.cn_flags & GIANTHELD) {
|
||||
mtx_unlock(&Giant);
|
||||
nd.ni_cnd.cn_flags &= ~GIANTHELD;
|
||||
}
|
||||
|
||||
if (error == 0) {
|
||||
bzero((caddr_t)fhp, sizeof(nfh));
|
||||
|
@ -876,6 +876,10 @@ nfs_namei(struct nameidata *ndp, fhandle_t *fhp, int len,
|
||||
}
|
||||
if (!lockleaf)
|
||||
cnp->cn_flags &= ~LOCKLEAF;
|
||||
if (cnp->cn_flags & GIANTHELD) {
|
||||
mtx_unlock(&Giant);
|
||||
cnp->cn_flags &= ~GIANTHELD;
|
||||
}
|
||||
|
||||
/*
|
||||
* nfs_namei() guarentees that fields will not contain garbage
|
||||
|
Loading…
x
Reference in New Issue
Block a user