Merge ~raharper/ubuntu/+source/mdadm:fix/lp-1753786-mdadm-last-resort-active-arrach into ubuntu/+source/mdadm:ubuntu/devel

Proposed by Ryan Harper
Status: Needs review
Proposed branch: ~raharper/ubuntu/+source/mdadm:fix/lp-1753786-mdadm-last-resort-active-arrach
Merge into: ubuntu/+source/mdadm:ubuntu/devel
Diff against target: 77 lines (+55/-0)
3 files modified
debian/changelog (+8/-0)
debian/patches/mdadm-last-resort-use-condition-path-exists.patch (+46/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Scott Moser (community) Approve
Review via email: mp+340951@code.launchpad.net

Description of the change

mdadm (4.0-2ubuntu1) bionic; urgency=medium

  * Cherry-pick upstream patch to ensure mdadm-last-resort services
    only runs when it is needed LP: #1753786
    - debian/patches/mdadm-last-resort-use-condition-path-exists.patch

 -- Ryan Harper <email address hidden> Wed, 07 Mar 2018 01:43:16 -0600

To post a comment you must log in.
Scott Moser (smoser) wrote :

I'm uploading. I did make a few small changes:
a.) update-maintainer (this is required since we previously had no delta).
b.) update the patch dep3 headers to add:
Bug-Debian: https://bugs.debian.org/892257
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1753786
Origin: upstream, https://github.com/neilbrown/mdadm/commit/5c4b3b9aa9f576305b36d5ccbd4b929b51307ce9

review: Approve

Unmerged commits

4961272... by Ryan Harper on 2018-03-07

Changelog entry for mdadm-last-resort service patch

1956bba... by Ryan Harper on 2018-03-07

mdadm-last-resort: use condition-path-exists to control service

Add patch to ensure mdadm-last-resort service only runs when needed.

e9530d5... by Dimitri John Ledkov on 2017-10-10

Import patches-unapplied version 4.0-2 to debian/sid

Imported using git-ubuntu import.

Changelog parent: 41d04194ff57de6e60a5823df15e6679e3f67ff7

New changelog entries:
  * Ship mdadm-shutdown.service and suggest dracut-core. Users of systemd
    with rootfs on Intel Matrix Raid and DDF external metadata-raid arrays
    that require mdmon monitoring, may wish to install dracut-core package
    and enable mdadm-shutdown.service. This will create a shutdown
    initramfs, that systemd-shutdown can pivot to. This may result in an
    improved shutdown behaviour with less hangs and synced raid
    arrays. The generated initramfs will takeover mdmon monitoring, wait
    for the arrays to be clean before stopping them and unmounting
    everything and finally executing requested shutdown command.
  * Bump standards version, no changes required.
  * Bump debhelper to 9.
  * Add second email address to avoid NMU warnings.

41d0419... by Dimitri John Ledkov on 2017-06-22

Import patches-unapplied version 4.0-1 to debian/sid

Imported using git-ubuntu import.

Changelog parent: 393a840628ca26e5386f69cef491a40dbf17a66c

New changelog entries:
  * New upstream release. LP: #1668128
  * Drop warnings that raid arrays are missing from the initramfs
    configuration. Instead have a positive message as to which arrays are
    included in the initramfs.
  * Add a warning to mkconf generated file that mdadm.conf is copied into
    initrafms.
  * Fix checkarray script bugs. LP: #1599428 Closes: #787950 Closes: #843665

393a840... by Dimitri John Ledkov on 2016-07-28

Import patches-unapplied version 3.4-4 to debian/sid

Imported using git-ubuntu import.

Changelog parent: b77369e42476e5c5568927e35d0ea0994e505cbb

New changelog entries:
  * Bring in changes from Ubuntu, to make the two packages in sync:
    - Drop README.Debian, quite out-of-date w.r.t. current packaging.
    - debian/control - on ubuntu, downgrade default-mta from Recommends to
    Suggests.
    - update-grub in postinst, if available (note does not update grub1).
    - drop stderr warnings in postrm.
    - drop presubj, out of date, and all types of bugs are welcomed.
    - on ubuntu, install apport package hook.
    - on ubuntu, install incremental assembly udev rules into udeb.

b77369e... by Dimitri John Ledkov on 2016-07-26

Import patches-unapplied version 3.4-3 to debian/sid

Imported using git-ubuntu import.

Changelog parent: a194bb2d0c6c1d0e0f4d767236f619b1556a2458

New changelog entries:
  * Fix UUID= grep for configured RAIDs to be case incesetive, regression from 3.4-2.
  * Re-trigger block devices at the start of local-block mdadm loop, to
    re-incrementally assemble disks that appeared before RAID
    personalities were registered with the kernel.
  * Also, invoke non-incremental assembly of raid arrays in the
    local-block loop to support running mdadm with user-exported variables
    specified via param.conf.
  * Set Vcs- fields to dgit repositories.
  * Closes: #830770, #830300.

a194bb2... by Dimitri John Ledkov on 2016-07-02

Import patches-unapplied version 3.4-2 to debian/sid

Imported using git-ubuntu import.

Changelog parent: ac6faa26272b01e0fb41135da65f8a294dc2454b

New changelog entries:
  * Reneable incremental assembly
  * Rely on udev to assemble incremental arrays
  * In environments with systemd rely on mdadm-last-resort@.timer|.service
    units to activate degrated raids
  * In environments initramfs-tools initrd (no systemd) add local-block
    script to do the same after 2/3rds of root delay iteration
  * Drop local-top initramfs script
  * Drop dependency on initscripts package
  * Drop INITRDSTART support
  * Drop mdadm-raid init script
  * Drop ancient preinst
  * In mdadm.init remove dependency on mdadm-raid
  * In mdadm.init check, and bail out running in a container
  * In mdadm.config drop mdadm/autostart logic
  * Drop CREATE stanzas from mkconf and don't include them in the
    initramfs. The generated defaults, are the compiled-in defaults. And
    the current one generates warnings when running mdadm in the
    initramfs, as there is no passwd|group files to resolve root/disk
    uid/gid. Closes: 717609
  * Adapt changes and formatting of initramfs hook from Ubuntu
  * Bump standards version to 3.9.7, no changes required
  * Fix copyright-refers-to-symlink-license
  * Closes: #781172, #796624, #769201, #813335, #632401, #804973, #714155,
    #770002, #737132, #675452, #726390, #813637, #814036.

ac6faa2... by Dimitri John Ledkov on 2016-02-19

Import patches-unapplied version 3.4-1 to debian/sid

Imported using git-ubuntu import.

Changelog parent: 376eb46b79d3cbf3b0e138ad88ac84a2484bef88

New changelog entries:
  * New upstream release.
  * Drop use-tempnode-not-devnode.patch, not needed anymore.
  * Drop use-external-blkid.diff. (Closes: #793631)
  * Refresh patches.

376eb46... by Yann Soubeyrand <email address hidden> on 2015-11-10

Import patches-unapplied version 3.3.4-1.1 to debian/sid

Imported using git-ubuntu import.

Changelog parent: c2e60ebe39c4efec7205501ba90ed5bc609d4034

New changelog entries:
  * Non-maintainer upload.
  * disable-incremental-assembly.patch: incremental assembly prevents booting
    in degraded mode (Closes: #784070)

c2e60eb... by Dimitri John Ledkov on 2015-11-08

Import patches-unapplied version 3.3.4-1 to debian/sid

Imported using git-ubuntu import.

Changelog parent: 717b2dead27bc46f8f8e0fbee4b7fd3d95e4ebbc

New changelog entries:
  [ Dimitri John Ledkov ]
  * Adopting the package as per mjt delegation. Thank you for your
    service mainting this package over the years, your contributions
    are highly appreciated by all of Debian and derivate communities.
  * New upstream release.
  * Bump standards version to 3.9.6.0, no changes required.
  * Use dh_prep instead of dh_clean -k
  * Drop cherrypicked patches.
  [ Helmut Grohne ]
  * Fix FTCBFS. Export CROSS_COMPILE=<triplet>- (Closes: #794335)
  [ Cyril B. ]
  * Copy AUTO lines from host into initrd, when updating initrd.
    (Closes: #785104)
  [ Martin von Wittich ]
  * Ignore errors attempting to apply *nice to checkarray, it may be
    done already. (Closes: #791554)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 0f6b9d2..69c65b3 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,11 @@
6+mdadm (4.0-2ubuntu1) bionic; urgency=medium
7+
8+ * Cherry-pick upstream patch to ensure mdadm-last-resort services
9+ only runs when it is needed LP: #1753786
10+ - debian/patches/mdadm-last-resort-use-condition-path-exists.patch
11+
12+ -- Ryan Harper <ryan.harper@canonical.com> Wed, 07 Mar 2018 01:43:16 -0600
13+
14 mdadm (4.0-2) unstable; urgency=medium
15
16 * Ship mdadm-shutdown.service and suggest dracut-core. Users of systemd
17diff --git a/debian/patches/mdadm-last-resort-use-condition-path-exists.patch b/debian/patches/mdadm-last-resort-use-condition-path-exists.patch
18new file mode 100644
19index 0000000..1697a57
20--- /dev/null
21+++ b/debian/patches/mdadm-last-resort-use-condition-path-exists.patch
22@@ -0,0 +1,46 @@
23+From 5c4b3b9aa9f576305b36d5ccbd4b929b51307ce9 Mon Sep 17 00:00:00 2001
24+From: NeilBrown <neilb@suse.com>
25+Date: Thu, 20 Apr 2017 12:40:05 +1000
26+Subject: [PATCH] systemd/mdadm-last-resort: use ConditionPathExists instead of
27+ Conflicts
28+
29+Commit cec72c071bbe ("systemd/mdadm-last-resort: add Conflicts to .service file.")
30+
31+added a 'Conflicts' directive to the mdadm-last-resort@.service file in
32+the hope that this would make sure the service didn't run after the device
33+was active, even if the timer managed to get started, which is possible in
34+race conditions.
35+
36+This seemed to work is testing, but it isn't clear why, and it is known
37+to cause problems.
38+If systemd happens to know that the mentioned device is a dependency of a
39+mount point, the Conflicts can unmount that mountpoint, which is certainly
40+not wanted.
41+
42+So remove the "Conflicts" and instead use
43+ ConditionPathExists=!/sys/devices/virtual/block/%i/md/sync_action
44+
45+The "sync_action" file exists for any array which requires last-resort
46+handling, and only appears when the array is activated. So it is safe
47+to rely on it to determine if the last-resort is really needed.
48+
49+Fixes: cec72c071bbe ("systemd/mdadm-last-resort: add Conflicts to .service file.")
50+Signed-off-by: NeilBrown <neilb@suse.com>
51+Signed-off-by: Jes Sorensen <jsorensen@fb.com>
52+---
53+ systemd/mdadm-last-resort@.service | 2 +-
54+ 1 file changed, 1 insertion(+), 1 deletion(-)
55+
56+diff --git a/systemd/mdadm-last-resort@.service b/systemd/mdadm-last-resort@.service
57+index e93d72b2..f9d4d127 100644
58+--- a/systemd/mdadm-last-resort@.service
59++++ b/systemd/mdadm-last-resort@.service
60+@@ -1,7 +1,7 @@
61+ [Unit]
62+ Description=Activate md array even though degraded
63+ DefaultDependencies=no
64+-Conflicts=sys-devices-virtual-block-%i.device
65++ConditionPathExists=!/sys/devices/virtual/block/%i/md/sync_action
66+
67+ [Service]
68+ Type=oneshot
69diff --git a/debian/patches/series b/debian/patches/series
70index 728fabf..73330d6 100644
71--- a/debian/patches/series
72+++ b/debian/patches/series
73@@ -3,3 +3,4 @@ debian-no-Werror.diff
74 sha1-includes.diff
75 readlink-path.patch
76 mdmonitor-service-simplify.diff
77+mdadm-last-resort-use-condition-path-exists.patch

Subscribers

People subscribed via source and target branches