diff options
author | NeilBrown <neilb@suse.de> | 2009-06-09 00:30:31 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-06-09 00:30:31 -0400 |
commit | f001a70cdc61c01452d42e8b32fd7c7842ef62d5 (patch) | |
tree | 6427a1baca4b818aa2081cbeb5534f2e6b17cf5e /drivers/md/raid5.c | |
parent | ccc0d38ec13d4649d4168c1db590137df53ad783 (diff) |
md/raid5: use conf->raid_disks in preference to mddev->raid_disk
mddev->raid_disks can be changed and any time by a request from
user-space. It is a suggestion as to what number of raid_disks is
desired.
conf->raid_disks can only be changed by the raid5 module with suitable
locks in place. It is a statement as to the current number of
raid_disks.
There are two places where the latter should be used, but the former
is used. This can lead to a crash when reshaping an array.
This patch changes to mddev-> to conf->
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r-- | drivers/md/raid5.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 5d400aef8d9b..75469e63ff10 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -3288,7 +3288,7 @@ static void unplug_slaves(mddev_t *mddev) | |||
3288 | int i; | 3288 | int i; |
3289 | 3289 | ||
3290 | rcu_read_lock(); | 3290 | rcu_read_lock(); |
3291 | for (i=0; i<mddev->raid_disks; i++) { | 3291 | for (i = 0; i < conf->raid_disks; i++) { |
3292 | mdk_rdev_t *rdev = rcu_dereference(conf->disks[i].rdev); | 3292 | mdk_rdev_t *rdev = rcu_dereference(conf->disks[i].rdev); |
3293 | if (rdev && !test_bit(Faulty, &rdev->flags) && atomic_read(&rdev->nr_pending)) { | 3293 | if (rdev && !test_bit(Faulty, &rdev->flags) && atomic_read(&rdev->nr_pending)) { |
3294 | struct request_queue *r_queue = bdev_get_queue(rdev->bdev); | 3294 | struct request_queue *r_queue = bdev_get_queue(rdev->bdev); |
@@ -4034,7 +4034,7 @@ static inline sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *ski | |||
4034 | * We don't need to check the 'failed' flag as when that gets set, | 4034 | * We don't need to check the 'failed' flag as when that gets set, |
4035 | * recovery aborts. | 4035 | * recovery aborts. |
4036 | */ | 4036 | */ |
4037 | for (i=0; i<mddev->raid_disks; i++) | 4037 | for (i = 0; i < conf->raid_disks; i++) |
4038 | if (conf->disks[i].rdev == NULL) | 4038 | if (conf->disks[i].rdev == NULL) |
4039 | still_degraded = 1; | 4039 | still_degraded = 1; |
4040 | 4040 | ||