diff options
author | iedowse <iedowse@FreeBSD.org> | 2001-05-11 20:42:41 +0000 |
---|---|---|
committer | iedowse <iedowse@FreeBSD.org> | 2001-05-11 20:42:41 +0000 |
commit | 33f5635b7705bc4e5d89ceb058b27b4468ded61a (patch) | |
tree | 8ca866e5d8d8dd38a95cb9f433aba2ad6ca354a9 /sys | |
parent | 2de47a2397f3311ff48bfb688c4c17e696ed33a9 (diff) | |
download | FreeBSD-src-33f5635b7705bc4e5d89ceb058b27b4468ded61a.zip FreeBSD-src-33f5635b7705bc4e5d89ceb058b27b4468ded61a.tar.gz |
In vrele() and vput(), avoid triggering the confusing "missed vn_close"
KASSERT when vp->v_usecount is zero or negative. In this case, the
"v*: negative ref cnt" panic that follows is much more appropriate.
Reviewed by: mckusick
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/vfs_subr.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 17d4089..cf2ea29 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1508,7 +1508,9 @@ vrele(vp) mtx_lock(&vp->v_interlock); - KASSERT(vp->v_writecount < vp->v_usecount, ("vrele: missed vn_close")); + /* Skip this v_writecount check if we're going to panic below. */ + KASSERT(vp->v_writecount < vp->v_usecount || vp->v_usecount < 1, + ("vrele: missed vn_close")); if (vp->v_usecount > 1) { @@ -1554,7 +1556,9 @@ vput(vp) KASSERT(vp != NULL, ("vput: null vp")); mtx_lock(&vp->v_interlock); - KASSERT(vp->v_writecount < vp->v_usecount, ("vput: missed vn_close")); + /* Skip this v_writecount check if we're going to panic below. */ + KASSERT(vp->v_writecount < vp->v_usecount || vp->v_usecount < 1, + ("vput: missed vn_close")); if (vp->v_usecount > 1) { |