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: md/raid1:Remove unnecessary rcu_dereference(conf->mirrors[i].rdev). Because  rde->nr_pending > 0,so can not remove this disk.
Date: Mon, 2 Apr 2012 11:03:40 +1000	[thread overview]
Message-ID: <20120402110340.1683d697@notabene.brown> (raw)
In-Reply-To: <201203281935226256403@gmail.com>

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

On Wed, 28 Mar 2012 19:46:56 +0800 "majianpeng" <majianpeng@gmail.com> wrote:

> >From 2d433ec2d351119afac6b57caa6cdec2197c0396 Mon Sep 17 00:00:00 2001
> From: majianpeng <majianpeng@gmail.com>
> Date: Wed, 28 Mar 2012 19:30:36 +0800
> Subject: [PATCH] md/raid1:Remove unnecessary  rcu_dereference(conf->mirrors[i].rdev). Because

Also, could you try to find a way to send the patches so that all the headers
aren't duplicated.  It means I have to go in and edit the patch description
of each patch to remove the duplication.


>  rde->nr_pending > 0,so can not remove this disk.
> 
> 
> Signed-off-by: majianpeng <majianpeng@gmail.com>
> ---
>  drivers/md/raid1.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
> index 4a40a20..f112782 100644
> --- a/drivers/md/raid1.c
> +++ b/drivers/md/raid1.c
> @@ -2386,8 +2386,7 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int *skipp
>  		int ok = 1;
>  		for (i = 0 ; i < conf->raid_disks * 2 ; i++)
>  			if (r1_bio->bios[i]->bi_end_io == end_sync_write) {
> -				struct md_rdev *rdev =
> -					rcu_dereference(conf->mirrors[i].rdev);
> +				struct md_rdev *rdev = conf->mirrors[i].rdev;
>  				ok = rdev_set_badblocks(rdev, sector_nr,
>  							min_bad, 0
>  					) && ok;

Correct, this rcu_dereference() isn't needed and is wrong.
I've applied your patch,
Thanks,
NeilBrown

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

      reply	other threads:[~2012-04-02  1:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-28 11:46 md/raid1:Remove unnecessary rcu_dereference(conf->mirrors[i].rdev). Because rde->nr_pending > 0,so can not remove this disk majianpeng
2012-04-02  1:03 ` 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=20120402110340.1683d697@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).