Bug 20619 - Failure to inform kernel about partition table changes when "Use entire disk" is selected in installer
Summary: Failure to inform kernel about partition table changes when "Use entire disk"...
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: release_blocker major
Target Milestone: ---
Assignee: Mageia tools maintainers
QA Contact:
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2017-04-02 22:04 CEST by Martin Whitaker
Modified: 2017-04-05 04:54 CEST (History)
1 user (show)

See Also:
Source RPM: draklive-install-2.10-1.mga6.src.rpm, drakxtools-17.75-1.mga6.src.rpm
CVE:
Status comment: Patches pushed, to be tested in drakx 17.77 or later and draklive-install 2.11 or later


Attachments
draklive-install patch to make partitioning more robust (1.31 KB, text/plain)
2017-04-02 22:04 CEST, Martin Whitaker
Details
Patch to drakxtools to make DOS partitioning more robust (2.36 KB, text/plain)
2017-04-02 22:12 CEST, Martin Whitaker
Details
Patch to improve speed and behaviour of proc_partitions::compare() (1.60 KB, text/plain)
2017-04-02 22:16 CEST, Martin Whitaker
Details

Description Martin Whitaker 2017-04-02 22:04:33 CEST
Created attachment 9171 [details]
draklive-install patch to make partitioning more robust

There is an unidentified condition that prevents udevd calling the BLKRRPART ioctl after a partition table is written. It looks like either the kernel or udevd drops device change events if they are too closely spaced in time. This has only been observed when selecting the "Use entire disk" partitioning solution.

Adding a 'udevadm settle' at an appropriate point in draklive-install appears to fix this (see accompanying patch), but it may be just the extra delay that is fixing the problem, so this is not necessarily 100% robust.
Comment 1 Martin Whitaker 2017-04-02 22:12:14 CEST
Created attachment 9172 [details]
Patch to drakxtools to make DOS partitioning more robust

This modifies dos::need_to_tell_kernel() to use proc_partitions::compare() to check that the kernel really has been informed about the partition table changes, and to indicate that we have to do it ourselves if not. This should make the behaviour entirely safe. Having said that, proc_partitions::compare() is not very rigorous, and maybe should be enhanced to check the partition sizes as well as the number of partitions.
Comment 2 Martin Whitaker 2017-04-02 22:16:17 CEST
Created attachment 9173 [details]
Patch to improve speed and behaviour of proc_partitions::compare()

proc_partitions::compare() calls proc_partitions::read(), which as well as reading information from /proc/partitions also probes the disk to determine the file system type in each partition. This not only slows down proc_partitions::compare(), it also generates unwanted udev events, which appear to reduce the chance of udevd calling the BLKRRPART ioctl. As the compare function doesn't use the file system type, we can skip probing the disk in this case.
Comment 3 Thierry Vignaud 2017-04-03 17:11:51 CEST
I think that 2nd patch is starting to make thing a little bit complex, that we try too hard...
But if your testing shows that it improves, just go...

CC: (none) => thierry.vignaud

Rémi Verschelde 2017-04-04 10:38:41 CEST

Status comment: (none) => Approved patchset, needs to be pushed to git and packaged

Rémi Verschelde 2017-04-04 20:08:13 CEST

Status comment: Approved patchset, needs to be pushed to git and packaged => Patches pushed, to be tested in drakx 17.77 or later

Rémi Verschelde 2017-04-04 20:09:32 CEST

Status comment: Patches pushed, to be tested in drakx 17.77 or later => Patches pushed, to be tested in drakx 17.77 or later and draklive-install 2.11 or later

Comment 4 Mageia Robot 2017-04-04 20:11:26 CEST
commit cad33aa626459fc8b210ee7d38035eb5373ddc0f
Author: Rémi Verschelde <rverschelde@...>
Date:   Tue Apr 4 20:10:56 2017 +0200

    Document previous commit for mga#20619
---
 Commit Link:
   http://gitweb.mageia.org/software/draklive-install/commit/?id=cad33aa626459fc8b210ee7d38035eb5373ddc0f
Comment 5 Thierry Vignaud 2017-04-05 04:54:59 CEST
Closing

Status: NEW => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.