summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2013-05-02 18:46:31 +0000
committerkib <kib@FreeBSD.org>2013-05-02 18:46:31 +0000
commita0955c41eef25623e633239b577325a2117af246 (patch)
tree5dbd5b4341aa5aeb8afb0fa1126c8f4adb7eda7a /sys/fs
parent5830ee0d3ff65246d6a80a17030fb0131023a3ce (diff)
downloadFreeBSD-src-a0955c41eef25623e633239b577325a2117af246.zip
FreeBSD-src-a0955c41eef25623e633239b577325a2117af246.tar.gz
Fix the v_object leak for non-regular tmpfs vnodes.
Reported and tested by: pho Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/tmpfs/tmpfs_vnops.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c
index 4808181..53f4882 100644
--- a/sys/fs/tmpfs/tmpfs_vnops.c
+++ b/sys/fs/tmpfs/tmpfs_vnops.c
@@ -264,6 +264,7 @@ tmpfs_open(struct vop_open_args *v)
error = EPERM;
else {
error = 0;
+ /* For regular files, the call below is nop. */
vnode_create_vobject(vp, node->tn_size, v->a_td);
}
@@ -1474,6 +1475,8 @@ tmpfs_reclaim(struct vop_reclaim_args *v)
if (vp->v_type == VREG)
tmpfs_destroy_vobject(vp, node->tn_reg.tn_aobj);
+ else
+ vnode_destroy_vobject(vp);
vp->v_object = NULL;
cache_purge(vp);
OpenPOWER on IntegriCloud