[Devel] Re: [PATCH] struct file leakage

Andrew Morton akpm at osdl.org
Tue Jul 11 16:32:54 PDT 2006


Trond Myklebust <trond.myklebust at fys.uio.no> wrote:
>
> > > -	if (error)
> > > +	if (error) {
> > > +		/* Does someone understand code flow here? Or it is only
> > > +		 * me so stupid? Anathema to whoever designed this non-sense
> > > +		 * with "intent.open".
> > > +		 */
> > > +		if (!IS_ERR(nd->intent.open.file))
> > > +			release_open_intent(nd);
> > >  		return error;
> > > +	}
> > >  	nd->flags &= ~LOOKUP_PARENT;
> > >  	if (nd->last_type == LAST_BIND)
> > >  		goto ok;
> > > 
> > 
> > It's good to have some more Alexeycomments in the tree.
> > 
> > I wonder if we're also needing a path_release() here.  And if not, whether
> > it is still safe to run release_open_intent() against this nameidata?
> > 
> > Hopefully Trond can recall what's going on in there...
> 
> The patch looks correct, except that I believe we can skip the IS_ERR()
> test there: if we're following links then we presumably have not tried
> to open any files yet, so the call to release_open_intent(nd) can be
> made unconditional.

Sorry, but phrases like "looks correct" and "I believe" don't inspire
confidence.  (Although what you say looks correct ;)) Are you sure?

And do we also need a path_release(nd) in there?




More information about the Devel mailing list