From 0c23d26230a134c6fc3159e5c131eaa874f6b9be Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Sat, 5 Dec 2020 05:56:23 +0000 Subject: [PATCH] vfs: keep bad ops on vnode reclaim They were only modified to accomodate a redundant assertion. This runs into problems as lockless lookup can still try to use the vnode and crash instead of getting an error. The bug was only present in kernels with INVARIANTS. Reported by: kevans --- sys/kern/vfs_subr.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 4a988f9dd57a..0f9fb5fe263c 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1816,10 +1816,6 @@ freevnode(struct vnode *vp) destroy_vpollinfo(vp->v_pollinfo); vp->v_pollinfo = NULL; } -#ifdef INVARIANTS - /* XXX Elsewhere we detect an already freed vnode via NULL v_op. */ - vp->v_op = NULL; -#endif vp->v_mountedhere = NULL; vp->v_unpcb = NULL; vp->v_rdev = NULL; @@ -3458,8 +3454,6 @@ vdrop_deactivate(struct vnode *vp) */ VNASSERT(!VN_IS_DOOMED(vp), vp, ("vdrop: returning doomed vnode")); - VNASSERT(vp->v_op != NULL, vp, - ("vdrop: vnode already reclaimed.")); VNASSERT((vp->v_iflag & VI_OWEINACT) == 0, vp, ("vnode with VI_OWEINACT set")); VNASSERT((vp->v_iflag & VI_DEFINACT) == 0, vp,