Date: Thu, 5 Sep 2019 18:19:51 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351882 - head/sys/kern Message-ID: <201909051819.x85IJpMp049134@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mjg Date: Thu Sep 5 18:19:51 2019 New Revision: 351882 URL: https://svnweb.freebsd.org/changeset/base/351882 Log: 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 Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Thu Sep 5 18:07:40 2019 (r351881) +++ head/sys/kern/vfs_subr.c Thu Sep 5 18:19:51 2019 (r351882) @@ -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); /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909051819.x85IJpMp049134>