svn commit: r356470 - head/sys/kern

Mateusz Guzik mjg at FreeBSD.org
Tue Jan 7 20:24:22 UTC 2020


Author: mjg
Date: Tue Jan  7 20:24:21 2020
New Revision: 356470
URL: https://svnweb.freebsd.org/changeset/base/356470

Log:
  vfs: handle doomed vnodes in vdefer_inactive
  
  vgone dooms the vnode while keeping VI_OWEINACT set and then drops the
  interlock.
  
  vputx can pick up the interlock and pass it to vdefer_inactive since the
  flag is set.
  
  The race is harmless, just don't defer anything as vgone will take care of it.
  
  Reported by:	pho

Modified:
  head/sys/kern/vfs_subr.c

Modified: head/sys/kern/vfs_subr.c
==============================================================================
--- head/sys/kern/vfs_subr.c	Tue Jan  7 20:13:31 2020	(r356469)
+++ head/sys/kern/vfs_subr.c	Tue Jan  7 20:24:21 2020	(r356470)
@@ -3018,8 +3018,10 @@ vdefer_inactive(struct vnode *vp)
 	ASSERT_VI_LOCKED(vp, __func__);
 	VNASSERT(vp->v_iflag & VI_OWEINACT, vp,
 	    ("%s: vnode without VI_OWEINACT", __func__));
-	VNASSERT(!VN_IS_DOOMED(vp), vp,
-	    ("%s: doomed vnode", __func__));
+	if (VN_IS_DOOMED(vp)) {
+		vdropl(vp);
+		return;
+	}
 	if (vp->v_iflag & VI_DEFINACT) {
 		VNASSERT(vp->v_holdcnt > 1, vp, ("lost hold count"));
 		vdropl(vp);
@@ -3036,8 +3038,7 @@ vdefer_inactive_cond(struct vnode *vp)
 
 	VI_LOCK(vp);
 	VNASSERT(vp->v_holdcnt > 0, vp, ("vnode without hold count"));
-	if (VN_IS_DOOMED(vp) ||
-	    (vp->v_iflag & VI_OWEINACT) == 0) {
+	if ((vp->v_iflag & VI_OWEINACT) == 0) {
 		vdropl(vp);
 		return;
 	}


More information about the svn-src-head mailing list