Mageia Bugzilla – Attachment 9173 Details for
Bug 20619
Failure to inform kernel about partition table changes when "Use entire disk" is selected in installer
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
Patch to improve speed and behaviour of proc_partitions::compare()
0002-Speed-up-proc_partitions-compare-and-avoid-unwanted-.patch (text/plain), 1.60 KB, created by
Martin Whitaker
on 2017-04-02 22:16:17 CEST
(
hide
)
Description:
Patch to improve speed and behaviour of proc_partitions::compare()
Filename:
MIME Type:
Creator:
Martin Whitaker
Created:
2017-04-02 22:16:17 CEST
Size:
1.60 KB
patch
obsolete
>From 82322713f201dca440a2aadebc04c3fc4bf0cad1 Mon Sep 17 00:00:00 2001 >From: Martin Whitaker <mageia@martin-whitaker.me.uk> >Date: Sun, 2 Apr 2017 20:02:13 +0100 >Subject: [PATCH 2/2] Speed up proc_partitions::compare() and avoid unwanted > udev events. > >The compare function doesn't look at the filesystem type, so there's >no need to probe it. > >This avoids unwanted udev events when we are checking that the kernel >has been informed of partition table changes. > >diff --git a/perl-install/fs/proc_partitions.pm b/perl-install/fs/proc_partitions.pm >index a6006a3..ea714ca 100644 >--- a/perl-install/fs/proc_partitions.pm >+++ b/perl-install/fs/proc_partitions.pm >@@ -20,7 +20,7 @@ sub read_raw() { > } > > sub read { >- my ($hds) = @_; >+ my ($hds, $o_ignore_fstype) = @_; > > my @all = read_raw(); > my ($parts, $_disks) = partition { $_->{dev} =~ /\d$/ && $_->{dev} !~ /^(sr|scd)/ } @all; >@@ -40,7 +40,7 @@ sub read { > $part->{size} *= 2; # from KB to sectors > $part->{start} = $prev_part ? $prev_part->{start} + $prev_part->{size} : 0; > require fs::type; >- put_in_hash($part, fs::type::type_subpart_from_magic($part)); >+ put_in_hash($part, fs::type::type_subpart_from_magic($part)) if !$o_ignore_fstype; > $prev_part = $part; > delete $part->{dev}; # cleanup > } >@@ -54,7 +54,7 @@ sub compare { > > > my @l1 = partition_table::get_normal_parts($hd); >- my @l2 = grep { $_->{rootDevice} eq $hd->{device} } &read([$hd]); >+ my @l2 = grep { $_->{rootDevice} eq $hd->{device} } &read([$hd], 1); > > #- /proc/partitions includes partition with type "empty" and a non-null size > #- so add them for comparison >-- >2.10.2 >
From 82322713f201dca440a2aadebc04c3fc4bf0cad1 Mon Sep 17 00:00:00 2001 From: Martin Whitaker <mageia@martin-whitaker.me.uk> Date: Sun, 2 Apr 2017 20:02:13 +0100 Subject: [PATCH 2/2] Speed up proc_partitions::compare() and avoid unwanted udev events. The compare function doesn't look at the filesystem type, so there's no need to probe it. This avoids unwanted udev events when we are checking that the kernel has been informed of partition table changes. diff --git a/perl-install/fs/proc_partitions.pm b/perl-install/fs/proc_partitions.pm index a6006a3..ea714ca 100644 --- a/perl-install/fs/proc_partitions.pm +++ b/perl-install/fs/proc_partitions.pm @@ -20,7 +20,7 @@ sub read_raw() { } sub read { - my ($hds) = @_; + my ($hds, $o_ignore_fstype) = @_; my @all = read_raw(); my ($parts, $_disks) = partition { $_->{dev} =~ /\d$/ && $_->{dev} !~ /^(sr|scd)/ } @all; @@ -40,7 +40,7 @@ sub read { $part->{size} *= 2; # from KB to sectors $part->{start} = $prev_part ? $prev_part->{start} + $prev_part->{size} : 0; require fs::type; - put_in_hash($part, fs::type::type_subpart_from_magic($part)); + put_in_hash($part, fs::type::type_subpart_from_magic($part)) if !$o_ignore_fstype; $prev_part = $part; delete $part->{dev}; # cleanup } @@ -54,7 +54,7 @@ sub compare { my @l1 = partition_table::get_normal_parts($hd); - my @l2 = grep { $_->{rootDevice} eq $hd->{device} } &read([$hd]); + my @l2 = grep { $_->{rootDevice} eq $hd->{device} } &read([$hd], 1); #- /proc/partitions includes partition with type "empty" and a non-null size #- so add them for comparison -- 2.10.2
View Attachment As Raw
Actions:
View
Attachments on
bug 20619
:
9171
|
9172
| 9173