Subject: Re: kern/36162: genfs_node_destroy breaks error paths
To: None <ad@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org,>
From: Antti Kantee <pooka@cs.hut.fi>
List: netbsd-bugs
Date: 10/16/2007 13:30:03
The following reply was made to PR kern/36162; it has been noted by GNATS.

From: Antti Kantee <pooka@cs.hut.fi>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/36162: genfs_node_destroy breaks error paths
Date: Tue, 16 Oct 2007 16:27:32 +0300

 On Tue Apr 17 2007 at 11:30:01 +0000, ad@netbsd.org wrote:
 > pooka@ noted that genfs_node_destroy can be called (due to error)
 > while the inode is not fully initialized. genfs_node_init may not
 > always have been called on it.
 > >How-To-Repeat:
 > Code inspection.
 > >Fix:
 > Call genfs_node_init immediatley after allocating the inode.
 
 There is also another similar problem due to the introduction of
 genfs_node_destroy().  If the vnode op vector is changed to fifo or spec,
 genfs_node_destroy() never gets called since the reclaim method is a
 null operation.
 
 Maybe genfs should be initialized only for REG vnodes?  Or does anyone
 have any actually nice solution suggestions?
 
 -- 
 Antti Kantee <pooka@iki.fi>                     Of course he runs NetBSD
 http://www.iki.fi/pooka/                          http://www.NetBSD.org/
     "la qualité la plus indispensable du cuisinier est l'exactitude"