From: Andre Noll <maan@systemlinux.org>
To: Dan Carpenter <error27@gmail.com>
Cc: Neil Brown <neilb@suse.de>,
Robert Becker <Rob.Becker@riverbed.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Jens Axboe <jens.axboe@oracle.com>,
linux-raid@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] md/raid10: check for ERR_PTR returns from setup_conf()
Date: Tue, 25 May 2010 14:56:13 +0000 [thread overview]
Message-ID: <20100525145613.GD1211@skl-net.de> (raw)
In-Reply-To: <20100525094017.GD22515@bicker>
[-- Attachment #1: Type: text/plain, Size: 1062 bytes --]
On 11:40, Dan Carpenter wrote:
> setup_conf() can return error values so I added a check for that here.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
>
> diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
> index 0372499..8bd7da2 100644
> --- a/drivers/md/raid10.c
> +++ b/drivers/md/raid10.c
> @@ -2454,6 +2454,8 @@ static void *raid10_takeover_raid0(mddev_t *mddev)
> mddev->recovery_cp = MaxSector;
>
> conf = setup_conf(mddev);
> + if (IS_ERR(conf))
> + return conf;
> conf->scale_disks = 2;
> return conf;
> }
Looks good. Feel free to add my Acked-By.
BTW: setup_conf() could use some cleanup: The "couldn't allocate
memory" error message at the bottom is misleading, and the function
returns ERR_PTR(-ENOMEM) also if md_register_thread() fails.
Here's a question for Neil: raid10_takeover_raid0() sets
mddev->new_layout, but setup_conf() uses the old values of the
raid0. How is this supposed to work?
Thanks
Andre
--
The only person who always got his work done by Friday was Robinson Crusoe
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
prev parent reply other threads:[~2010-05-25 14:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-25 9:40 [patch] md/raid10: check for ERR_PTR returns from setup_conf() Dan Carpenter
2010-05-25 14:56 ` Andre Noll [this message]
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=20100525145613.GD1211@skl-net.de \
--to=maan@systemlinux.org \
--cc=Rob.Becker@riverbed.com \
--cc=error27@gmail.com \
--cc=jens.axboe@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=neilb@suse.de \
/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