Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 517986 - =sys-apps/systemd-215*: creates inactive MD devices upon stopping them
Summary: =sys-apps/systemd-215*: creates inactive MD devices upon stopping them
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo systemd Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-24 15:27 UTC by Sebastian Parschauer
Modified: 2014-07-25 13:19 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Parschauer 2014-07-24 15:27:09 UTC
We've installed the udev-215.ebuild on some of our storage servers where we create temporary MD devices to just create the MD metadata.

The issue is that udev creates inactive MD devices when stopping them. The following commands are already enough to create such device:

mknod /dev/md0 b 9 0
xxd /dev/md0

/sys/block/md0/ is created upon the open() call.

After "mdadm --stop /dev/md0" udev recreates such inactive device. Only stopping the udev daemon helps to prevent that.

Reference: http://www.spinics.net/lists/raid/msg46676.html

According to Artur Paszkiewicz from Intel this is caused by this change in udev:

> commit 3ebdb81ef088afd3b4c72b516beb5610f8c93a0d
> Author: Kay Sievers <kay at vrfy.org>
> Date:   Sun Apr 13 19:54:27 2014 -0700
>
>      udev: serialize/synchronize block device event handling with file locks
>
> http://cgit.freedesktop.org/systemd/systemd/commit/?id=3ebdb81ef088afd3b4c72b516beb5610f8c93a0d
>
> It seems that they have already disabled this for dm for some reason,
> but not for md:
>
> commit e918a1b5a94f270186dca59156354acd2a596494
> Author: Kay Sievers <kay@vrfy.org>
> Date:   Tue Jun 3 16:49:38 2014 +0200
>
>     udev: exclude device-mapper from block device ownership event locking
>
> http://cgit.freedesktop.org/systemd/systemd/commit/?id=e918a1b5a94f270186dca59156354acd2a596494
>

The issue is already reported upstream to linux-hotplug and linux-raid.

Subject: udev 215 creates inactive MD devices upon stopping them
Message-ID: <53D11CCA.1050602@profitbricks.com>
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2014-07-24 15:35:40 UTC
The issue should have reported to systemd-devel@ mailing list at freedesktop.org (the current udev mailing list)
Because I'm not sure if Kay is reading linux-raid@
Comment 2 Sebastian Parschauer 2014-07-24 15:56:11 UTC
I've sent it to him directly. This systemd-devel@ mailing list at freedesktop.org rejects mails from non-subscribers and I don't want to subscribe to each and every mailing list I want to report a bug to.
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2014-07-24 16:40:18 UTC
I'm subscribed to both, linux-raid@ and systemd-devel@, so I've forwarded it to systemd-devel@ as well

I suppose we could (try to) revert the problematic patch in a revision bump, since I don't understand this part of the codebase, until we get reply from Kay
Intrested in providing such an patch? If not, I'll work on it later...
Comment 5 Samuli Suominen (RETIRED) gentoo-dev 2014-07-25 04:04:16 UTC
(In reply to Mike Gilbert from comment #4)
> http://cgit.freedesktop.org/systemd/systemd/commit/
> ?id=2e5b17d01347d3c3118be2b8ad63d20415dbb1f0

in 215-r1

reassigning to systemd@ so you can apply it too

ccing eudev@ to make them aware of this problem as well
Comment 6 Pacho Ramos gentoo-dev 2014-07-25 10:27:01 UTC
+*systemd-215-r3 (25 Jul 2014)
+
+  25 Jul 2014; Pacho Ramos <pacho@gentoo.org>
+  +files/215-0003-udev-exclude-MD-from-block-device-ownership-event-lo.patch,
+  +systemd-215-r3.ebuild, -systemd-215-r1.ebuild, -systemd-215-r2.ebuild:
+  Fix creation of inactive MD devices (#517986), drop old.
+