linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: majianpeng <majianpeng@gmail.com>
Cc: linux-raid <linux-raid@vger.kernel.org>
Subject: Re: [PATCH] md/raid1: Initialize conf->raid_disks before using it.
Date: Thu, 25 Oct 2012 09:56:57 +1100	[thread overview]
Message-ID: <20121025095657.7c3b6e5f@notabene.brown> (raw)
In-Reply-To: <201210241600489486705@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1169 bytes --]

On Wed, 24 Oct 2012 16:00:53 +0800 majianpeng <majianpeng@gmail.com> wrote:

> Because the conf->raid_disks is zero at first,so if there is a
> replacement disk, func setup_conf will abort.
> 
> Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
> ---
>  drivers/md/raid1.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
> index 8034fbd..4eec567 100644
> --- a/drivers/md/raid1.c
> +++ b/drivers/md/raid1.c
> @@ -2703,6 +2703,7 @@ static struct r1conf *setup_conf(struct mddev *mddev)
>  
>  	err = -EINVAL;
>  	spin_lock_init(&conf->device_lock);
> +	conf->raid_disks = mddev->raid_disks;
>  	rdev_for_each(rdev, mddev) {
>  		struct request_queue *q;
>  		int disk_idx = rdev->raid_disk;
> @@ -2724,7 +2725,6 @@ static struct r1conf *setup_conf(struct mddev *mddev)
>  		disk->head_position = 0;
>  		disk->seq_start = MaxSector;
>  	}
> -	conf->raid_disks = mddev->raid_disks;
>  	conf->mddev = mddev;
>  	INIT_LIST_HEAD(&conf->retry_list);
>  

Thanks.  I had already discovered that bug and have a fix in my tree.  I just
haven't pushed it out yet.

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

      reply	other threads:[~2012-10-24 22:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-24  8:00 [PATCH] md/raid1: Initialize conf->raid_disks before using it majianpeng
2012-10-24 22:56 ` NeilBrown [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=20121025095657.7c3b6e5f@notabene.brown \
    --to=neilb@suse.de \
    --cc=linux-raid@vger.kernel.org \
    --cc=majianpeng@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).