diff options
-rw-r--r-- | perl-install/diskdrake/interactive.pm | 6 | ||||
-rw-r--r-- | perl-install/raid.pm | 9 |
2 files changed, 8 insertions, 7 deletions
diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm index e478d9e86..c974444d2 100644 --- a/perl-install/diskdrake/interactive.pm +++ b/perl-install/diskdrake/interactive.pm @@ -1006,15 +1006,15 @@ sub is_part_existing { sub modifyRAID { my ($in, $raids, $md_part) = @_; - my $prev_device = $md_part->{device}; + my $new_device = $md_part->{device}; $in->ask_from('', '', [ -{ label => N("device"), val => \$md_part->{device}, list => [ $md_part->{device}, raid::free_mds($raids) ], sort => 0 }, +{ label => N("device"), val => \$new_device, list => [ $md_part->{device}, raid::free_mds($raids) ], sort => 0 }, { label => N("level"), val => \$md_part->{level}, list => [ qw(0 1 4 5 linear) ] }, { label => N("chunk size in KiB"), val => \$md_part->{'chunk-size'} }, ], ) or return; - raid::change_device($md_part, $prev_device); + raid::change_device($md_part, $new_device); raid::updateSize($md_part); # changing the raid level changes the size available 1; } diff --git a/perl-install/raid.pm b/perl-install/raid.pm index d52956935..3b66c8c08 100644 --- a/perl-install/raid.pm +++ b/perl-install/raid.pm @@ -56,10 +56,11 @@ sub delete { } sub change_device { - my ($md_part, $prev_device) = @_; - if ($prev_device ne $md_part->{device}) { - inactivate_and_dirty({ device => $prev_device }); - $_->{raid} = $md_part->{device} foreach @{$md_part->{disks}}; + my ($md_part, $new_device) = @_; + if ($new_device ne $md_part->{device}) { + inactivate_and_dirty($md_part); + $md_part->{device} = $new_device; + $_->{raid} = $new_device foreach @{$md_part->{disks}}; } } |