Author: kib
Date: Thu May  2 18:46:31 2013
New Revision: 250190
URL: http://svnweb.freebsd.org/changeset/base/250190

Log:
  Fix the v_object leak for non-regular tmpfs vnodes.
  
  Reported and tested by:       pho
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/fs/tmpfs/tmpfs_vnops.c

Modified: head/sys/fs/tmpfs/tmpfs_vnops.c
==============================================================================
--- head/sys/fs/tmpfs/tmpfs_vnops.c     Thu May  2 18:44:31 2013        
(r250189)
+++ head/sys/fs/tmpfs/tmpfs_vnops.c     Thu May  2 18:46:31 2013        
(r250190)
@@ -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);
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to