From 84dc43637ffed98c10f3d536f44099eabdb0bd07 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Fri, 30 Apr 2010 13:46:51 +0000 Subject: fix resize of active encrypted volumes --- perl-install/NEWS | 1 + perl-install/diskdrake/interactive.pm | 18 ++++++++++++------ perl-install/install/NEWS | 1 + 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/perl-install/NEWS b/perl-install/NEWS index 241576eff..44093b17a 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,5 +1,6 @@ - diskdrake: o fix the crypto mountpoint checks for the create case + o fix resize of active encrypted volumes Version 13.22 - 29 April 2010 diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm index 51c25703c..535de67ec 100644 --- a/perl-install/diskdrake/interactive.pm +++ b/perl-install/diskdrake/interactive.pm @@ -756,7 +756,13 @@ sub Mount_point_raw_hd { sub Resize { my ($in, $hd, $part) = @_; my (%nice_resize); - my ($min, $max) = (min_partition_size($hd), max_partition_resize($hd, $part)); + my $low_part = $part; + + if (isLUKS($part)) { + $low_part = find { $_->{dm_name} eq $part->{dmcrypt_name} } partition_table::get_normal_parts($hd); + } + + my ($min, $max) = (min_partition_size($hd), max_partition_resize($hd, $low_part)); if (maybeFormatted($part)) { # here we may have a non-formatted or a formatted partition @@ -832,8 +838,8 @@ sub Resize { $part->{size} == $size and return; my $oldsize = $part->{size}; - $part->{size} = $size; - $hd->adjustEnd($part); + $low_part->{size} = $part->{size} = $size; + $hd->adjustEnd($low_part); undef $@; my $_b = before_leaving { $@ and $part->{size} = $oldsize }; @@ -842,10 +848,10 @@ sub Resize { my ($write_partitions) = @_; if (isLVM($hd)) { - lvm::lv_resize($part, $oldsize); + lvm::lv_resize($low_part, $oldsize); } else { - partition_table::will_tell_kernel($hd, resize => $part); - partition_table::adjust_local_extended($hd, $part); + partition_table::will_tell_kernel($hd, resize => $low_part); + partition_table::adjust_local_extended($hd, $low_part); partition_table::adjust_main_extended($hd); write_partitions($in, $hd) or return if $write_partitions && %nice_resize; } diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index a9d32f32c..f91df8316 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -1,5 +1,6 @@ - diskdrake: o fix the crypto mountpoint checks for the create case + o fix resize of active encrypted volumes Version 13.22 - 29 April 2010 -- cgit v1.2.1