diff options
author | mckusick <mckusick@FreeBSD.org> | 2015-12-04 03:54:18 +0000 |
---|---|---|
committer | mckusick <mckusick@FreeBSD.org> | 2015-12-04 03:54:18 +0000 |
commit | 1a9ecd3df94c4288283e8beb306463d6464a4302 (patch) | |
tree | addba6b6224d7f76958864ebd4b21a0b16df8edf /sys/kern | |
parent | 5a6402b7b4b65d5b297a1fa59523fdc1d03631de (diff) | |
download | FreeBSD-src-1a9ecd3df94c4288283e8beb306463d6464a4302.zip FreeBSD-src-1a9ecd3df94c4288283e8beb306463d6464a4302.tar.gz |
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
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_subr.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index ff37de8..2ec5bc1 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -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; |