diff options
author | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2017-01-21 19:38:55 +0000 |
---|---|---|
committer | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2017-02-25 11:30:56 +0000 |
commit | a5473711818b2519552561b33c3f181ab1bbfde6 (patch) | |
tree | 86370a8a42e2503b9cf16bf46ab1a825b39bfdef /perl-install/partition_table/sun.pm | |
parent | 6f2b411522ec6d503390b1bb51a3ce24d0407d9d (diff) | |
download | drakx-a5473711818b2519552561b33c3f181ab1bbfde6.tar drakx-a5473711818b2519552561b33c3f181ab1bbfde6.tar.gz drakx-a5473711818b2519552561b33c3f181ab1bbfde6.tar.bz2 drakx-a5473711818b2519552561b33c3f181ab1bbfde6.tar.xz drakx-a5473711818b2519552561b33c3f181ab1bbfde6.zip |
Ensure the kernel doesn't rescan a partially written partition table (mga#20074).
When no partitions on a DOS-partitioned disk are mounted, the kernel
automatically rescans the partition table when the file handle to the
raw device is released. Currently the code opens and closes the raw
device when writing the primary partition table and when writing each
extended partition table segment. As the extended partition table
segments form a linked list, this allows the kernel to get in and
rescan the table when the list is not in a coherent state. This patch
changes the code to open the raw device before writing the primary
partition table and to close it only after writing the last extended
partition table segment.
The behaviour for other partition table types is unchanged.
v2 (tvignaud): simplify by moving copies of noop funcs into the base class
Diffstat (limited to 'perl-install/partition_table/sun.pm')
-rw-r--r-- | perl-install/partition_table/sun.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/perl-install/partition_table/sun.pm b/perl-install/partition_table/sun.pm index e2fd747ac..e665d0168 100644 --- a/perl-install/partition_table/sun.pm +++ b/perl-install/partition_table/sun.pm @@ -119,7 +119,7 @@ sub read_one { # write the partition table (and extended ones) # for each entry, it uses fields: start, size, pt_type, active sub write($$$;$) { - my ($hd, $sector, $pt, $info) = @_; + my ($hd, $_handle, $sector, $pt, $info) = @_; # my ($csize, $wdsize) = (0, 0); #- handle testing for writing partition table on file only! |