Commit a9ad8526 authored by Jonathan Brassow's avatar Jonathan Brassow Committed by NeilBrown

DM RAID: Use safe version of rdev_for_each

Fix segfault caused by using rdev_for_each instead of rdev_for_each_safe

Commit dafb20fa mistakenly replaced a safe
iterator with an unsafe one when making some macro changes.
Signed-off-by: default avatarJonathan Brassow <jbrassow@redhat.com>
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent afbaa90b
...@@ -859,7 +859,7 @@ static int analyse_superblocks(struct dm_target *ti, struct raid_set *rs) ...@@ -859,7 +859,7 @@ static int analyse_superblocks(struct dm_target *ti, struct raid_set *rs)
int ret; int ret;
unsigned redundancy = 0; unsigned redundancy = 0;
struct raid_dev *dev; struct raid_dev *dev;
struct md_rdev *rdev, *freshest; struct md_rdev *rdev, *tmp, *freshest;
struct mddev *mddev = &rs->md; struct mddev *mddev = &rs->md;
switch (rs->raid_type->level) { switch (rs->raid_type->level) {
...@@ -877,7 +877,7 @@ static int analyse_superblocks(struct dm_target *ti, struct raid_set *rs) ...@@ -877,7 +877,7 @@ static int analyse_superblocks(struct dm_target *ti, struct raid_set *rs)
} }
freshest = NULL; freshest = NULL;
rdev_for_each(rdev, mddev) { rdev_for_each_safe(rdev, tmp, mddev) {
if (!rdev->meta_bdev) if (!rdev->meta_bdev)
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment