dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Luis Chamberlain <mcgrof@kernel.org>
To: Ming Lei <ming.lei@redhat.com>
Cc: ulf.hansson@linaro.org, snitzer@redhat.com,
	linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
	dm-devel@redhat.com, Christoph Hellwig <hch@lst.de>,
	agk@redhat.com, beanhuo@micron.com, sagi@grimberg.me,
	linux-scsi@vger.kernel.org, hch@infradead.org,
	jejb@linux.ibm.com, josef@toxicpanda.com, swboyd@chromium.org,
	linux-block@vger.kernel.org, avri.altman@wdc.com,
	kbusch@kernel.org, nbd@other.debian.org, bvanassche@acm.org,
	axboe@kernel.dk, martin.petersen@oracle.com,
	linux-mmc@vger.kernel.org, adrian.hunter@intel.com
Subject: Re: [dm-devel] [PATCH v3 1/8] scsi/sd: add error handling support for add_disk()
Date: Mon, 13 Sep 2021 10:21:24 -0700	[thread overview]
Message-ID: <YT+IlJnSZzG0j0ON@bombadil.infradead.org> (raw)
In-Reply-To: <YTbAYyo0+rqUZ+L0@T590>

On Tue, Sep 07, 2021 at 09:29:07AM +0800, Ming Lei wrote:
> On Mon, Aug 30, 2021 at 02:25:31PM -0700, Luis Chamberlain wrote:
> > We never checked for errors on add_disk() as this function
> > returned void. Now that this is fixed, use the shiny new
> > error handling.
> > 
> > Reviewed-by: Christoph Hellwig <hch@lst.de>
> > Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
> > ---
> >  drivers/scsi/sd.c | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> > index 610ebba0d66e..8c1273fff23e 100644
> > --- a/drivers/scsi/sd.c
> > +++ b/drivers/scsi/sd.c
> > @@ -3487,7 +3487,11 @@ static int sd_probe(struct device *dev)
> >  		pm_runtime_set_autosuspend_delay(dev,
> >  			sdp->host->hostt->rpm_autosuspend_delay);
> >  	}
> > -	device_add_disk(dev, gd, NULL);
> > +
> > +	error = device_add_disk(dev, gd, NULL);
> > +	if (error)
> > +		goto out_free_index;
> > +
> 
> The error handling is actually wrong, see 
> 
> 	https://lore.kernel.org/linux-scsi/c93f3010-13c9-e07f-1458-b6b47a27057b@acm.org/T/#t
> 
> Maybe you can base on that patch.

Done, thanks!

 Luis

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


  reply	other threads:[~2021-09-13 17:26 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-30 21:25 [dm-devel] [PATCH v3 0/8] block: first batch of add_disk() error handling conversions Luis Chamberlain
2021-08-30 21:25 ` [dm-devel] [PATCH v3 1/8] scsi/sd: add error handling support for add_disk() Luis Chamberlain
2021-09-06  6:13   ` Hannes Reinecke
2021-09-07  1:29   ` Ming Lei
2021-09-13 17:21     ` Luis Chamberlain [this message]
2021-08-30 21:25 ` [dm-devel] [PATCH v3 2/8] scsi/sr: " Luis Chamberlain
2021-09-06  6:13   ` Hannes Reinecke
2021-09-07  1:37   ` Ming Lei
2021-09-13 17:26     ` Luis Chamberlain
2021-08-30 21:25 ` [dm-devel] [PATCH v3 3/8] nvme: " Luis Chamberlain
2021-09-06  6:16   ` Hannes Reinecke
2021-09-06  8:09     ` Christoph Hellwig
2021-09-06  8:09   ` Christoph Hellwig
2021-08-30 21:25 ` [dm-devel] [PATCH v3 4/8] mmc/core/block: " Luis Chamberlain
2021-09-06 17:10   ` Ulf Hansson
2021-08-30 21:25 ` [dm-devel] [PATCH v3 5/8] md: " Luis Chamberlain
2021-09-06  6:17   ` Hannes Reinecke
2021-08-30 21:25 ` [dm-devel] [PATCH v3 6/8] dm: add add_disk() error handling Luis Chamberlain
2021-09-06  6:19   ` Hannes Reinecke
2021-08-30 21:25 ` [dm-devel] [PATCH v3 7/8] loop: add error handling support for add_disk() Luis Chamberlain
2021-09-06  6:19   ` Hannes Reinecke
2021-08-30 21:25 ` [dm-devel] [PATCH v3 8/8] nbd: " Luis Chamberlain
2021-09-06  6:20   ` Hannes Reinecke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YT+IlJnSZzG0j0ON@bombadil.infradead.org \
    --to=mcgrof@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=agk@redhat.com \
    --cc=avri.altman@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=dm-devel@redhat.com \
    --cc=hch@infradead.org \
    --cc=hch@lst.de \
    --cc=jejb@linux.ibm.com \
    --cc=josef@toxicpanda.com \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=ming.lei@redhat.com \
    --cc=nbd@other.debian.org \
    --cc=sagi@grimberg.me \
    --cc=snitzer@redhat.com \
    --cc=swboyd@chromium.org \
    --cc=ulf.hansson@linaro.org \
    --subject='Re: [dm-devel] [PATCH v3 1/8] scsi/sd: add error handling support for add_disk()' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).