From f261a1bfc75de53582a15c48f5f7df8d59ce0d95 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 21 Aug 2003 00:52:41 +0000 Subject: allocatePartitions() resulted in a small unallocated area at the end of the drive when: - suggest_part() reserves some room for the other partitions which are going to be added next. For maxsize limited partition, it reserves maxsize (if maxsize is reached) - suggest_part() which adds the last partition limited by maxsize can be called on a partition a little bigger than maxsize due to cylinder boundary adjustments on previous partition creations. In that case, it doesn't use the full area. It occured for example with the current $fsedit::suggestions{server}. The fix chosen is to ensure the last suggest_part() is called with a size defined as maxsize <= size < maxsize + cylinder_size. --- perl-install/fsedit.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm index 318892f87..897b387bb 100644 --- a/perl-install/fsedit.pm +++ b/perl-install/fsedit.pm @@ -424,6 +424,7 @@ sub computeSize { 1; } else { 0 } } @$suggestions; + my $cylinder_size_maxsize_adjusted; my $tot_ratios = 0; while (1) { my $old_free_space = $free_space; @@ -437,6 +438,9 @@ sub computeSize { $_->{size} + $_->{ratio} / $tot_ratios * $old_free_space >= $_->{maxsize}) { return min($max, $best->{maxsize}) if $best->{mntpoint} eq $_->{mntpoint}; $free_space -= $_->{maxsize} - $_->{size}; + if (!$cylinder_size_maxsize_adjusted++) { + eval { $free_space += part2hd($part, $all_hds)->cylinder_size - 1 }; + } 0; } else { $_->{ratio}; -- cgit v1.2.1