vfs: temporarily revert r351825

There are 2 problems:
- it introduces a funny bug where it can end up trylocking the same vnode [1]
- it exposes a pre-existing softdep deadlock [2]

Both are easier to run into that the bug which got fixed, so revert until
a complete solution is worked out.

Reported by:	cy [1], pho [2]
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Mateusz Guzik 2019-09-05 18:19:51 +00:00
parent 8262585607
commit 68c3c1abe1

View File

@ -1102,6 +1102,7 @@ vnlru_free_locked(int count, struct vfsops *mnt_op)
("Removing vnode not on freelist"));
KASSERT((vp->v_iflag & VI_ACTIVE) == 0,
("Mangling active vnode"));
TAILQ_REMOVE(&vnode_free_list, vp, v_actfreelist);
/*
* Don't recycle if our vnode is from different type
@ -1113,6 +1114,7 @@ vnlru_free_locked(int count, struct vfsops *mnt_op)
*/
if ((mnt_op != NULL && (mp = vp->v_mount) != NULL &&
mp->mnt_op != mnt_op) || !VI_TRYLOCK(vp)) {
TAILQ_INSERT_TAIL(&vnode_free_list, vp, v_actfreelist);
continue;
}
VNASSERT((vp->v_iflag & VI_FREE) != 0 && vp->v_holdcnt == 0,
@ -1127,8 +1129,11 @@ vnlru_free_locked(int count, struct vfsops *mnt_op)
* activating.
*/
freevnodes--;
vp->v_iflag &= ~VI_FREE;
VNODE_REFCOUNT_FENCE_REL();
refcount_acquire(&vp->v_holdcnt);
mtx_unlock(&vnode_free_list_mtx);
vholdl(vp);
VI_UNLOCK(vp);
vtryrecycle(vp);
/*