Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Dec 2015 03:54:18 +0000 (UTC)
From:      Kirk McKusick <mckusick@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r291743 - head/sys/kern
Message-ID:  <201512040354.tB43sIMq058969@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mckusick
Date: Fri Dec  4 03:54:18 2015
New Revision: 291743
URL: https://svnweb.freebsd.org/changeset/base/291743

Log:
  We need to zero out the clustering variables in a freed vnode structure.
  For completeness add a VNASSERT that there are no threads waiting on a
  range lock (this was previously checked on every vnode free).
  
  Reported by; Rick Macklem
  Fix from:    Mateusz Guzik
  PR:          204949

Modified:
  head/sys/kern/vfs_subr.c

Modified: head/sys/kern/vfs_subr.c
==============================================================================
--- head/sys/kern/vfs_subr.c	Fri Dec  4 03:44:12 2015	(r291742)
+++ head/sys/kern/vfs_subr.c	Fri Dec  4 03:54:18 2015	(r291743)
@@ -2770,6 +2770,8 @@ _vdrop(struct vnode *vp, bool locked)
 	VNASSERT(TAILQ_EMPTY(&vp->v_cache_dst), vp, ("vp has namecache dst"));
 	VNASSERT(LIST_EMPTY(&vp->v_cache_src), vp, ("vp has namecache src"));
 	VNASSERT(vp->v_cache_dd == NULL, vp, ("vp has namecache for .."));
+	VNASSERT(TAILQ_EMPTY(&vp->v_rl.rl_waiters), vp,
+	    ("Dangling rangelock waiters"));
 	VI_UNLOCK(vp);
 #ifdef MAC
 	mac_vnode_destroy(vp);
@@ -2783,6 +2785,7 @@ _vdrop(struct vnode *vp, bool locked)
 	vp->v_op = NULL;
 #endif
 	bzero(&vp->v_un, sizeof(vp->v_un));
+	vp->v_lasta = vp->v_clen = vp->v_cstart = vp->v_lastw = 0;
 	vp->v_iflag = 0;
 	vp->v_vflag = 0;
 	bo->bo_flag = 0;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201512040354.tB43sIMq058969>