summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_export.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/vfs_export.c')
-rw-r--r--sys/kern/vfs_export.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c
index 97d6251..e0ef113 100644
--- a/sys/kern/vfs_export.c
+++ b/sys/kern/vfs_export.c
@@ -1701,8 +1701,23 @@ vclean(vp, flags, p)
if (VOP_RECLAIM(vp, p))
panic("vclean: cannot reclaim");
- if (active)
- vrele(vp);
+ if (active) {
+ /*
+ * Inline copy of vrele() since VOP_INACTIVE
+ * has already been called.
+ */
+ simple_lock(&vp->v_interlock);
+ if (--vp->v_usecount <= 0) {
+#ifdef DIAGNOSTIC
+ if (vp->v_usecount < 0 || vp->v_writecount != 0) {
+ vprint("vclean: bad ref count", vp);
+ panic("vclean: ref cnt");
+ }
+#endif
+ vfree(vp);
+ }
+ simple_unlock(&vp->v_interlock);
+ }
cache_purge(vp);
if (vp->v_vnlock) {
OpenPOWER on IntegriCloud