From e4fb0c6d7fbe0fc8f8659f0d39510aad4dc95999 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 15 Jul 1999 14:58:15 +0000 Subject: *** empty log message *** --- perl-install/partition_table.pm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'perl-install/partition_table.pm') diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm index d4c8b2484..3ebd47122 100644 --- a/perl-install/partition_table.pm +++ b/perl-install/partition_table.pm @@ -168,7 +168,7 @@ sub read($;$) { $hd->{primary} = $pt; $hd->{extended} = undef; - $clearall and return $hd->{isDirty} = 1; + $clearall and return $hd->{isDirty} = $hd->{needKernelReread} = 1; my @l = (@{$pt->{normal}}, $pt->{extended}); foreach my $i (@l) { foreach (@l) { @@ -226,8 +226,11 @@ sub write($) { $hd->{isDirty} = 0; # now sync disk and re-read the partition table - sync(); - partition_table_raw::kernel_read($hd); + if ($hd->{needKernelReread}) { + sync(); + partition_table_raw::kernel_read($hd); + $hd->{needKernelReread} = 0; + } } sub active($$) { @@ -249,7 +252,7 @@ sub remove($$) { splice(@{$hd->{primary}->{normal}}, $i, 1); %$_ = (); - return $hd->{isDirty} = 1; + return $hd->{isDirty} = $hd->{needKernelReread} = 1; } $i++; } @@ -260,7 +263,7 @@ sub remove($$) { %{$last->{extended}} = $_->{extended} ? %{$_->{extended}} : (); splice(@{$hd->{extended}}, $i, 1); - return $hd->{isDirty} = 1; + return $hd->{isDirty} = $hd->{needKernelReread} = 1; } $last = $_; $i++; @@ -276,7 +279,7 @@ sub add($$) { $part->{notFormatted} = 1; $part->{isFormatted} = 0; $part->{rootDevice} = $hd->{device}; - $hd->{isDirty} = 1; + $hd->{isDirty} = $hd->{needKernelReread} = 1; adjustStartAndEnd($hd, $part); if (is_empty_array_ref($hd->{primary}->{normal})) { -- cgit v1.2.1