From: Andrew Morton <akpm@linux-foundation.org>
To: Nikanth Karthikesan <knikanth@suse.de>
Cc: axboe@kernel.dk, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Fix error handling in add_disk
Date: Tue, 23 Jun 2009 14:23:57 -0700 [thread overview]
Message-ID: <20090623142357.b2050c14.akpm@linux-foundation.org> (raw)
In-Reply-To: <200906171231.10438.knikanth@suse.de>
On Wed, 17 Jun 2009 12:31:10 +0530
Nikanth Karthikesan <knikanth@suse.de> wrote:
> Fix error handling in add_disk. Also add WARN_ON()'s in case
> of error, which can be removed once the callers handle the error.
>
I have a vague ancestral memory that some of the unchecked errors which
you're now checking for actually do happen in practice, and that this
"fix" will end up breaking currently-working setups.
Or maybe I'm thinking of a similar but different piece of code (maybe
it was the partition code?).
Still, I think it would be prudent to initially make this patch
continue to ignore the errors. So add the warnings, but don't change
the response to errors. Then we can get the change distributed for a
bit of testing and if that all looks good then we can add the control
flow changes later.
> retval = blk_alloc_devt(&disk->part0, &devt);
> if (retval) {
> WARN_ON(1);
> - return;
> + goto err_out;
> }
> ...
> + if (retval) {
> + WARN_ON(1);
> + goto err_free_devt;
> + }
> ...
> + if (retval) {
> + WARN_ON(1);
> + goto err_free_region;
> + }
> ...
> - WARN_ON(retval);
> + if (retval) {
> + WARN_ON(1);
> + goto err_free_queue;
> + }
These all can be coded as
if (WARN_ON(retval))
goto foo;
next prev parent reply other threads:[~2009-06-23 21:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-17 7:01 [PATCH] Fix error handling in add_disk Nikanth Karthikesan
2009-06-23 21:23 ` Andrew Morton [this message]
2009-06-24 6:48 ` Nikanth Karthikesan
2009-06-25 3:11 ` Andrew Morton
2009-06-25 10:17 ` Nikanth Karthikesan
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=20090623142357.b2050c14.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=knikanth@suse.de \
--cc=linux-kernel@vger.kernel.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox