- File systems that wish to inspect the vnode contents or their private
v_data field before calling vget/vn_lock must check VI_XLOCK manually to be sure that v_data is still valid. Implement this check in two places here.
This commit is contained in:
parent
ea5c2ab712
commit
6acdfd69be
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=120783
@ -577,6 +577,10 @@ ext2_reload(mountp, cred, td)
|
||||
}
|
||||
nvp = TAILQ_NEXT(vp, v_nmntvnodes);
|
||||
VI_LOCK(vp);
|
||||
if (vp->v_iflag & VI_XLOCK) {
|
||||
VI_UNLOCK(vp);
|
||||
continue;
|
||||
}
|
||||
mtx_unlock(&mntvnode_mtx);
|
||||
/*
|
||||
* Step 4: invalidate all inactive vnodes.
|
||||
@ -906,6 +910,10 @@ ext2_sync(mp, waitfor, cred, td)
|
||||
goto loop;
|
||||
nvp = TAILQ_NEXT(vp, v_nmntvnodes);
|
||||
VI_LOCK(vp);
|
||||
if (vp->v_iflag & VI_XLOCK) {
|
||||
VI_UNLOCK(vp);
|
||||
continue;
|
||||
}
|
||||
mtx_unlock(&mntvnode_mtx);
|
||||
ip = VTOI(vp);
|
||||
if (vp->v_type == VNON ||
|
||||
|
@ -577,6 +577,10 @@ ext2_reload(mountp, cred, td)
|
||||
}
|
||||
nvp = TAILQ_NEXT(vp, v_nmntvnodes);
|
||||
VI_LOCK(vp);
|
||||
if (vp->v_iflag & VI_XLOCK) {
|
||||
VI_UNLOCK(vp);
|
||||
continue;
|
||||
}
|
||||
mtx_unlock(&mntvnode_mtx);
|
||||
/*
|
||||
* Step 4: invalidate all inactive vnodes.
|
||||
@ -906,6 +910,10 @@ ext2_sync(mp, waitfor, cred, td)
|
||||
goto loop;
|
||||
nvp = TAILQ_NEXT(vp, v_nmntvnodes);
|
||||
VI_LOCK(vp);
|
||||
if (vp->v_iflag & VI_XLOCK) {
|
||||
VI_UNLOCK(vp);
|
||||
continue;
|
||||
}
|
||||
mtx_unlock(&mntvnode_mtx);
|
||||
ip = VTOI(vp);
|
||||
if (vp->v_type == VNON ||
|
||||
|
Loading…
Reference in New Issue
Block a user