Skip to content

Commit

Permalink
DM RAID: Use safe version of rdev_for_each
Browse files Browse the repository at this point in the history
Fix segfault caused by using rdev_for_each instead of rdev_for_each_safe

Commit dafb20f 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>
  • Loading branch information
Jonathan Brassow authored and NeilBrown committed Apr 24, 2012
1 parent afbaa90 commit a9ad852
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/md/dm-raid.c
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ static int analyse_superblocks(struct dm_target *ti, struct raid_set *rs)
int ret;
unsigned redundancy = 0;
struct raid_dev *dev;
struct md_rdev *rdev, *freshest;
struct md_rdev *rdev, *tmp, *freshest;
struct mddev *mddev = &rs->md;

switch (rs->raid_type->level) {
Expand All @@ -877,7 +877,7 @@ static int analyse_superblocks(struct dm_target *ti, struct raid_set *rs)
}

freshest = NULL;
rdev_for_each(rdev, mddev) {
rdev_for_each_safe(rdev, tmp, mddev) {
if (!rdev->meta_bdev)
continue;

Expand Down

0 comments on commit a9ad852

Please sign in to comment.