On Wed, Aug 07, 2013 at 01:02:30PM -0700, Zach Brown wrote:
> > --- a/fs/btrfs/ctree.c
> > +++ b/fs/btrfs/ctree.c
> > @@ -1211,7 +1211,8 @@ tree_mod_log_rewind(struct btrfs_fs_info *fs_info, 
> > struct extent_buffer *eb,
> >             BUG_ON(tm->slot != 0);
> >             eb_rewin = alloc_dummy_extent_buffer(eb->start,
> >                                             fs_info->tree_root->nodesize);
> > -           BUG_ON(!eb_rewin);
> > +           if (!eb_rewin)
> > +                   return ERR_PTR(-ENOMEM);
> 
> Don't these error paths need to unlock and free eb...
> 
> > @@ -2772,6 +2774,10 @@ again:
> >                                                       BTRFS_READ_LOCK);
> >                     }
> >                     b = tree_mod_log_rewind(root->fs_info, b, time_seq);
> > +                   if (IS_ERR(b)) {
> > +                           ret = PTR_ERR(b);
> > +                           goto done;
> > +                   }
> 
> ... because this b = doit(, b, ) will leak the b input eb if the b
> return is an error pointer?
> 

Ah yeah I completely missed that, thanks.

Josef
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to