linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* md/raid1:Remove unnecessary  rcu_dereference(conf->mirrors[i].rdev). Because  rde->nr_pending > 0,so can not remove this disk.
@ 2012-03-28 11:46 majianpeng
  2012-04-02  1:03 ` NeilBrown
  0 siblings, 1 reply; 2+ messages in thread
From: majianpeng @ 2012-03-28 11:46 UTC (permalink / raw)
  To: Neil Brown; +Cc: linux-raid

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
 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;
-- 
1.7.5.4

 				
--------------
majianpeng
2012-03-28


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: md/raid1:Remove unnecessary rcu_dereference(conf->mirrors[i].rdev). Because  rde->nr_pending > 0,so can not remove this disk.
  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
  0 siblings, 0 replies; 2+ messages in thread
From: NeilBrown @ 2012-04-02  1:03 UTC (permalink / raw)
  To: majianpeng; +Cc: linux-raid

[-- 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 --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-04-02  1:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).