PERFORCE change 122478 for review
Roman Divacky
rdivacky at FreeBSD.org
Thu Jun 28 11:50:12 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=122478
Change 122478 by rdivacky at rdivacky_witten on 2007/06/28 11:49:10
Lock Giant in a case of non-MPSAFE fs. Put in some forgotten vrele(dvp)...
Affected files ...
.. //depot/projects/soc2007/rdivacky/linux_at/sys/kern/vfs_syscalls.c#39 edit
Differences ...
==== //depot/projects/soc2007/rdivacky/linux_at/sys/kern/vfs_syscalls.c#39 (text+ko) ====
@@ -994,6 +994,8 @@
*dvpp = NULL;
return (ENOTDIR);
}
+ if (VFS_NEEDSGIANT((*dvpp)->v_mount))
+ mtx_lock(&Giant);
}
return (0);
@@ -1161,8 +1163,11 @@
VFS_UNLOCK_GIANT(vfslocked);
fdclose(fdp, fp, indx, td);
fdrop(fp, td);
- if (dvp)
+ if (dvp) {
vrele(dvp);
+ if (VFS_NEEDSGIANT(dvp->v_mount))
+ mtx_unlock(&Giant);
+ }
return (error);
}
@@ -1266,8 +1271,11 @@
if (error)
return (error);
restart:
- if (dvp)
+ if (dvp) {
vrele(dvp);
+ if (VFS_NEEDSGIANT(dvp->v_mount))
+ mtx_unlock(&Giant);
+ }
error = kern_get_at(td, fd, &dvp);
if (error && !kern_absolute_path(path, pathseg))
return (error);
@@ -1345,8 +1353,11 @@
vput(nd.ni_vp);
}
}
- if (dvp)
+ if (dvp) {
vrele(dvp);
+ if (VFS_NEEDSGIANT(dvp->v_mount))
+ mtx_unlock(&Giant);
+ }
NDFREE(&nd, NDF_ONLY_PNBUF);
vput(nd.ni_dvp);
vn_finished_write(mp);
@@ -1407,8 +1418,11 @@
AUDIT_ARG(mode, mode);
restart:
- if (dvp)
+ if (dvp) {
vrele(dvp);
+ if (VFS_NEEDSGIANT(dvp->v_mount))
+ mtx_unlock(&Giant);
+ }
error = kern_get_at(td, fd, &dvp);
if (error && !kern_absolute_path(path, pathseg))
return (error);
@@ -1462,8 +1476,11 @@
#ifdef MAC
out:
#endif
- if (dvp)
+ if (dvp) {
vrele(dvp);
+ if (VFS_NEEDSGIANT(dvp->v_mount))
+ mtx_unlock(&Giant);
+ }
vput(nd.ni_dvp);
vn_finished_write(mp);
VFS_UNLOCK_GIANT(vfslocked);
@@ -1584,7 +1601,10 @@
error = kern_get_at(td, fd2, &ldvp);
if (error && !kern_absolute_path(path2, segflg)) {
- if (pdvp)
+ if (pdvp) {
+ if (VFS_NEEDSGIANT(pdvp->v_mount))
+ mtx_unlock(&Giant);
+ }
vrele(pdvp);
return (error);
}
@@ -1641,10 +1661,16 @@
VFS_UNLOCK_GIANT(vfslocked);
out:
- if (pdvp)
+ if (pdvp) {
vrele(pdvp);
- if (ldvp)
+ if (VFS_NEEDSGIANT(pdvp->v_mount))
+ mtx_unlock(&Giant);
+ }
+ if (ldvp) {
vrele(ldvp);
+ if (VFS_NEEDSGIANT(ldvp->v_mount))
+ mtx_unlock(&Giant);
+ }
return (error);
}
@@ -1710,8 +1736,11 @@
}
AUDIT_ARG(text, syspath);
restart:
- if (dvp)
+ if (dvp) {
vrele(dvp);
+ if (VFS_NEEDSGIANT(dvp->v_mount))
+ mtx_unlock(&Giant);
+ }
error = kern_get_at(td, fd, &dvp);
if (error && !kern_absolute_path(path2, segflg))
return (error);
@@ -1763,8 +1792,11 @@
vn_finished_write(mp);
VFS_UNLOCK_GIANT(vfslocked);
out:
- if (dvp)
+ if (dvp) {
vrele(dvp);
+ if (VFS_NEEDSGIANT(dvp->v_mount))
+ mtx_unlock(&Giant);
+ }
if (segflg != UIO_SYSSPACE)
uma_zfree(namei_zone, syspath);
return (error);
@@ -1878,8 +1910,11 @@
int vfslocked;
restart:
- if (dvp)
+ if (dvp) {
vrele(dvp);
+ if (VFS_NEEDSGIANT(dvp->v_mount))
+ mtx_unlock(&Giant);
+ }
error = kern_get_at(td, fd, &dvp);
if (error && !kern_absolute_path(path, pathseg))
return (error);
@@ -1936,8 +1971,11 @@
}
NDFREE(&nd, NDF_ONLY_PNBUF);
vput(nd.ni_dvp);
- if (dvp)
+ if (dvp) {
vrele(dvp);
+ if (VFS_NEEDSGIANT(dvp->v_mount))
+ mtx_unlock(&Giant);
+ }
if (vp == nd.ni_dvp)
vrele(vp);
else
@@ -2189,8 +2227,11 @@
out:
td->td_ucred = cred;
crfree(tmpcred);
- if (dvp)
+ if (dvp) {
vrele(dvp);
+ if (VFS_NEEDSGIANT(dvp->v_mount))
+ mtx_unlock(&Giant);
+ }
return (error);
}
@@ -2405,8 +2446,11 @@
if (error == 0)
*sbp = sb;
out:
- if (dvp)
+ if (dvp) {
vrele(dvp);
+ if (VFS_NEEDSGIANT(dvp->v_mount))
+ mtx_unlock(&Giant);
+ }
return (error);
}
@@ -2469,8 +2513,11 @@
if (error == 0)
*sbp = sb;
out:
- if (dvp)
+ if (dvp) {
vrele(dvp);
+ if (VFS_NEEDSGIANT(dvp->v_mount))
+ mtx_unlock(&Giant);
+ }
return (error);
}
@@ -2695,8 +2742,11 @@
VFS_UNLOCK_GIANT(vfslocked);
td->td_retval[0] = count - auio.uio_resid;
out:
- if (dvp)
+ if (dvp) {
vrele(dvp);
+ if (VFS_NEEDSGIANT(dvp->v_mount))
+ mtx_unlock(&Giant);
+ }
return (error);
}
@@ -2942,8 +2992,11 @@
vrele(nd.ni_vp);
VFS_UNLOCK_GIANT(vfslocked);
out:
- if (dvp)
+ if (dvp) {
vrele(dvp);
+ if (VFS_NEEDSGIANT(dvp->v_mount))
+ mtx_unlock(&Giant);
+ }
return (error);
}
@@ -2991,6 +3044,12 @@
error = setfmode(td, nd.ni_vp, mode);
vrele(nd.ni_vp);
VFS_UNLOCK_GIANT(vfslocked);
+ if (dvp) {
+ vrele(dvp);
+ if (VFS_NEEDSGIANT(dvp->v_mount))
+ mtx_unlock(&Giant);
+ }
+
return (error);
}
@@ -3132,8 +3191,11 @@
vrele(nd.ni_vp);
VFS_UNLOCK_GIANT(vfslocked);
out:
- if (dvp)
+ if (dvp) {
vrele(dvp);
+ if (VFS_NEEDSGIANT(dvp->v_mount))
+ mtx_unlock(&Giant);
+ }
return (error);
}
@@ -3190,8 +3252,11 @@
vrele(nd.ni_vp);
VFS_UNLOCK_GIANT(vfslocked);
out:
- if (dvp)
+ if (dvp) {
vrele(dvp);
+ if (VFS_NEEDSGIANT(dvp->v_mount))
+ mtx_unlock(&Giant);
+ }
return (error);
}
@@ -3377,8 +3442,11 @@
vrele(nd.ni_vp);
VFS_UNLOCK_GIANT(vfslocked);
out:
- if (dvp)
+ if (dvp) {
vrele(dvp);
+ if (VFS_NEEDSGIANT(dvp->v_mount))
+ mtx_unlock(&Giant);
+ }
return (error);
}
@@ -3766,7 +3834,10 @@
error = kern_get_at(td, newfd, &todvp);
if (error && !kern_absolute_path(new, pathseg)) {
- if (frdvp)
+ if (frdvp) {
+ if (VFS_NEEDSGIANT(frdvp->v_mount))
+ mtx_unlock(&Giant);
+ }
vrele(frdvp);
return (error);
}
@@ -3875,11 +3946,16 @@
if (error == -1)
return (0);
out2:
- if (frdvp)
+ if (frdvp) {
vrele(frdvp);
- if (todvp)
+ if (VFS_NEEDSGIANT(frdvp->v_mount))
+ mtx_unlock(&Giant);
+ }
+ if (todvp) {
vrele(todvp);
-
+ if (VFS_NEEDSGIANT(todvp->v_mount))
+ mtx_unlock(&Giant);
+ }
return (error);
}
@@ -3936,8 +4012,11 @@
AUDIT_ARG(mode, mode);
restart:
- if (dvp)
+ if (dvp) {
vrele(dvp);
+ if (VFS_NEEDSGIANT(dvp->v_mount))
+ mtx_unlock(&Giant);
+ }
error = kern_get_at(td, fd, &dvp);
if (error && !kern_absolute_path(path, segflg))
return (error);
@@ -3996,8 +4075,11 @@
#ifdef MAC
out:
#endif
- if (dvp)
+ if (dvp) {
vrele(dvp);
+ if (VFS_NEEDSGIANT(dvp->v_mount))
+ mtx_unlock(&Giant);
+ }
NDFREE(&nd, NDF_ONLY_PNBUF);
vput(nd.ni_dvp);
if (!error)
@@ -4042,6 +4124,11 @@
int vfslocked;
restart:
+ if (dvp) {
+ vrele(dvp);
+ if (VFS_NEEDSGIANT(dvp->v_mount))
+ mtx_unlock(&Giant);
+ }
error = kern_get_at(td, fd, &dvp);
if (error && !kern_absolute_path(path, pathseg))
return (error);
@@ -4095,6 +4182,11 @@
out:
NDFREE(&nd, NDF_ONLY_PNBUF);
vput(vp);
+ if (dvp) {
+ vrele(dvp);
+ if (VFS_NEEDSGIANT(dvp->v_mount))
+ mtx_unlock(&Giant);
+ }
if (nd.ni_dvp == vp)
vrele(nd.ni_dvp);
else
More information about the p4-projects
mailing list