- Increase the scope of the interlock in ffs_reload(). Acquire it before
we release the mntvnode_mtx. - Call vgonel() directly instead of going through vrecycle() since we own the interlock now. - Remove a few cases where we locked the interlock just so that we could call VOP_UNLOCK with interlock held.
This commit is contained in:
parent
934914d2ef
commit
04a17687ea
@ -428,9 +428,7 @@ ffs_reload(mp, cred, td)
|
||||
if (vn_isdisk(devvp, NULL)) {
|
||||
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
|
||||
vfs_object_create(devvp, td, td->td_ucred);
|
||||
/* XXX Why lock only to release immediately?? */
|
||||
mtx_lock(&devvp->v_interlock);
|
||||
VOP_UNLOCK(devvp, LK_INTERLOCK, td);
|
||||
VOP_UNLOCK(devvp, 0, td);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -504,17 +502,18 @@ ffs_reload(mp, cred, td)
|
||||
goto loop;
|
||||
}
|
||||
nvp = TAILQ_NEXT(vp, v_nmntvnodes);
|
||||
VI_LOCK(vp);
|
||||
mtx_unlock(&mntvnode_mtx);
|
||||
/*
|
||||
* Step 4: invalidate all inactive vnodes.
|
||||
*/
|
||||
if (vrecycle(vp, NULL, td))
|
||||
if (vp->v_usecount == 0) {
|
||||
vgonel(vp, td);
|
||||
goto loop;
|
||||
}
|
||||
/*
|
||||
* Step 5: invalidate all cached file data.
|
||||
*/
|
||||
/* XXX Why lock only to release immediately? */
|
||||
mtx_lock(&vp->v_interlock);
|
||||
if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) {
|
||||
goto loop;
|
||||
}
|
||||
@ -597,9 +596,7 @@ ffs_mountfs(devvp, mp, td)
|
||||
if (vn_isdisk(devvp, NULL)) {
|
||||
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
|
||||
vfs_object_create(devvp, td, cred);
|
||||
/* XXX Why lock only to release immediately?? */
|
||||
mtx_lock(&devvp->v_interlock);
|
||||
VOP_UNLOCK(devvp, LK_INTERLOCK, td);
|
||||
VOP_UNLOCK(devvp, 0, td);
|
||||
}
|
||||
|
||||
ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
|
||||
|
Loading…
Reference in New Issue
Block a user