lkml.org 
[lkml]   [2021]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 08/10] dm: add add_disk() error handling
On Tue, Aug 24, 2021 at 07:21:30AM +0100, Christoph Hellwig wrote:
> On Mon, Aug 23, 2021 at 01:29:28PM -0700, Luis Chamberlain wrote:
> > - add_disk(md->disk);
> > + r = add_disk(md->disk);
> > + if (r)
> > + goto out_cleanup_disk;
> >
> > r = dm_sysfs_init(md);
> > - if (r) {
> > - del_gendisk(md->disk);
> > - return r;
> > - }
> > + if (r)
> > + goto out_del_gendisk;
> > md->type = type;
> > return 0;
> > +
> > +out_cleanup_disk:
> > + blk_cleanup_disk(md->disk);
> > +out_del_gendisk:
> > + del_gendisk(md->disk);
> > + return r;
>
> I think the add_disk should just return r. If you look at the
> callers they eventualy end up in dm_table_destroy, which does
> this cleanup.

I don't see it. What part of dm_table_destroy() does this?

Luis

\
 
 \ /
  Last update: 2021-08-27 20:56    [W:0.794 / U:0.828 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site