xfs
[Top] [All Lists]

Re: [PATCH 7/7] split up xlog_recover_process_iunlinks

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 7/7] split up xlog_recover_process_iunlinks
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Wed, 29 Oct 2008 08:51:33 +1100
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20081028091446.GB1662@xxxxxxxxxxxxx>
Mail-followup-to: Christoph Hellwig <hch@xxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
References: <20081027133938.GH1109@xxxxxxxxxxxxx> <20081028071750.GV4985@disturbed> <20081028091446.GB1662@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.18 (2008-05-17)
On Tue, Oct 28, 2008 at 05:14:46AM -0400, Christoph Hellwig wrote:
> > > + error = xfs_iget(mp, NULL, ino, 0, 0, &ip, 0);
> > > + if (error)
> > > +         goto fail;
> > > +
> > > + /*
> > > +  * Get the on disk inode to find the next inode in the bucket.
> > > +  */
> > > + ASSERT(ip != NULL);
> > > + error = xfs_itobp(mp, NULL, ip, &dip, &ibp, 0, 0, XFS_BUF_LOCK);
> > > + if (error)
> > > +         goto fail;
> > 
> > Jumping to 'fail' at this point leaks the xfs_inode returned from
> > xfs_iget(). Hmmmm - it appears the original code leaked too....
> > 
> > Also, I don't think we need the assert for ip, either.  If it's NULL
> > then we'll panic immediately on entering xfs_itobp().
> 
> Yeah.  I'll fix this in a separate patch as this one is just suposed to
> be purely refactoring.

Ok, sounds fair.

Reviewed-by: Dave Chinner <david@xxxxxxxxxxxxx>

-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>