summaryrefslogtreecommitdiffstats
path: root/perl-install/partition_table/raw.pm
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2017-01-21 19:38:55 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2017-02-12 11:54:53 +0000
commit105d6bea5e69ee7011e5c468ba3cd05eb999b359 (patch)
treea8d28f5dc0bae2aadcb7c2a5397b12a35564b894 /perl-install/partition_table/raw.pm
parent498f6c3feb6213ff769826d06dae3c256ee612ef (diff)
downloaddrakx-105d6bea5e69ee7011e5c468ba3cd05eb999b359.tar
drakx-105d6bea5e69ee7011e5c468ba3cd05eb999b359.tar.gz
drakx-105d6bea5e69ee7011e5c468ba3cd05eb999b359.tar.bz2
drakx-105d6bea5e69ee7011e5c468ba3cd05eb999b359.tar.xz
drakx-105d6bea5e69ee7011e5c468ba3cd05eb999b359.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/raw.pm')
-rw-r--r--perl-install/partition_table/raw.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/perl-install/partition_table/raw.pm b/perl-install/partition_table/raw.pm
index 7b4e7d5cf..e9b293b90 100644
--- a/perl-install/partition_table/raw.pm
+++ b/perl-install/partition_table/raw.pm
@@ -295,4 +295,14 @@ A test to check the integrity of data has failed.
It means writing anything on the disk will end up with random, corrupted data.");
}
+sub start_write {
+ my ($_hd) = @_;
+ 1;
+}
+
+sub end_write {
+ my ($_hd, $_handle) = @_;
+ 1;
+}
+
1;