[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YSk1EhUIr9OjIoVv@bombadil.infradead.org>
Date: Fri, 27 Aug 2021 11:55:14 -0700
From: Luis Chamberlain <mcgrof@...nel.org>
To: Christoph Hellwig <hch@...radead.org>
Cc: axboe@...nel.dk, martin.petersen@...cle.com, jejb@...ux.ibm.com,
kbusch@...nel.org, sagi@...mberg.me, adrian.hunter@...el.com,
beanhuo@...ron.com, ulf.hansson@...aro.org, avri.altman@....com,
swboyd@...omium.org, agk@...hat.com, snitzer@...hat.com,
josef@...icpanda.com, hare@...e.de, bvanassche@....org,
ming.lei@...hat.com, linux-scsi@...r.kernel.org,
linux-nvme@...ts.infradead.org, linux-mmc@...r.kernel.org,
dm-devel@...hat.com, nbd@...er.debian.org,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [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
Powered by blists - more mailing lists