diff options
author | jeff <jeff@FreeBSD.org> | 2003-10-04 13:16:54 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2003-10-04 13:16:54 +0000 |
commit | c95a875344205952f20ff014cf829029ff0c4b26 (patch) | |
tree | 66e73d1a89e9e690fafcc4a31fb9869be0f82c3a /sys/coda | |
parent | ad0c897bd5484ef1949cfb2f0c11aceaff6cc2dd (diff) | |
download | FreeBSD-src-c95a875344205952f20ff014cf829029ff0c4b26.zip FreeBSD-src-c95a875344205952f20ff014cf829029ff0c4b26.tar.gz |
- Make proper use of the mntvnode_mtx. We do not need the loop label
because we do not drop the mntvnode_mtx. If this code had ever executed
and hit the loop condition it would have spun forever.
Diffstat (limited to 'sys/coda')
-rw-r--r-- | sys/coda/coda_subr.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/coda/coda_subr.c b/sys/coda/coda_subr.c index f9e0f56..9871bd6 100644 --- a/sys/coda/coda_subr.c +++ b/sys/coda/coda_subr.c @@ -312,11 +312,12 @@ coda_checkunmounting(mp) register struct vnode *vp, *nvp; struct cnode *cp; int count = 0, bad = 0; -loop: + + mtx_lock(&mntvnode_mtx); for (vp = TAILQ_FIRST(&mp->mnt_nvnodelist); vp; vp = nvp) { - if (vp->v_mount != mp) - goto loop; nvp = TAILQ_NEXT(vp, v_nmntvnodes); + if (vp->v_mount != mp) + continue; cp = VTOC(vp); count++; if (!(cp->c_flags & C_UNMOUNTING)) { @@ -325,6 +326,7 @@ loop: cp->c_flags |= C_UNMOUNTING; } } + mtx_unlock(&mntvnode_mtx); } void |