md/raid1:Remove unnecessary rcu_dereference(conf->mirrors[i].rdev).
authormajianpeng <majianpeng@gmail.com>
Sun, 1 Apr 2012 15:04:19 +0000 (01:04 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 3 Apr 2012 05:37:33 +0000 (15:37 +1000)
Because rde->nr_pending > 0,so can not remove this disk.
And in any case, we aren't holding rcu_read_lock()

Signed-off-by: majianpeng <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid1.c

index 242440831b23aa8e80e8097c59c7558ab30b8d97..8c420f178603b914a8c0b2deeff47caf043ee991 100644 (file)
@@ -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;