diff options
author | Jonathan Brassow <jbrassow@redhat.com> | 2012-04-23 20:23:13 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-04-23 20:23:13 -0400 |
commit | a9ad8526bb1af0741a5c0e01155dac08e7bdde60 (patch) | |
tree | 4e82b35b644eab0aacc6c7d16b2cb7794f106cb5 /drivers/md/dm-raid.c | |
parent | afbaa90b80b1ec66e5137cc3824746bfdf559b18 (diff) |
DM RAID: Use safe version of rdev_for_each
Fix segfault caused by using rdev_for_each instead of rdev_for_each_safe
Commit dafb20fa34320a472deb7442f25a0c086e0feb33 mistakenly replaced a safe
iterator with an unsafe one when making some macro changes.
Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/dm-raid.c')
-rw-r--r-- | drivers/md/dm-raid.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c index b0ba52459ed7..68965e663248 100644 --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c | |||
@@ -859,7 +859,7 @@ static int analyse_superblocks(struct dm_target *ti, struct raid_set *rs) | |||
859 | int ret; | 859 | int ret; |
860 | unsigned redundancy = 0; | 860 | unsigned redundancy = 0; |
861 | struct raid_dev *dev; | 861 | struct raid_dev *dev; |
862 | struct md_rdev *rdev, *freshest; | 862 | struct md_rdev *rdev, *tmp, *freshest; |
863 | struct mddev *mddev = &rs->md; | 863 | struct mddev *mddev = &rs->md; |
864 | 864 | ||
865 | switch (rs->raid_type->level) { | 865 | switch (rs->raid_type->level) { |
@@ -877,7 +877,7 @@ static int analyse_superblocks(struct dm_target *ti, struct raid_set *rs) | |||
877 | } | 877 | } |
878 | 878 | ||
879 | freshest = NULL; | 879 | freshest = NULL; |
880 | rdev_for_each(rdev, mddev) { | 880 | rdev_for_each_safe(rdev, tmp, mddev) { |
881 | if (!rdev->meta_bdev) | 881 | if (!rdev->meta_bdev) |
882 | continue; | 882 | continue; |
883 | 883 | ||