SHA256
1
0
forked from pool/systemd
systemd/1060-udev-use-device-mapper-target-name-for-btrfs-device-ready.patch
Dominique Leuenberger a4023d0c37 Accepting request 333777 from Base:System
- Fix patch tty-ask-password-agent-on-console.patch not to crash
  away but enable it to ask on all devices of /dev/console

- Avoid "file not found /etc/udev/rules.d/70-persistent-net.rules"
  waring occurring in %post

- Add patch let-vconsole-setup-get-properties-only-once-to-copy-them.patch
  to avoid broken virtual console mapping due stressed ioctl API
  for the virtual consoles (boo#904214)

- Fix last change that is use the new name for udev packages in %pretrans. 

- restore usage of LUA in %pretrans.

- Try to generate the systemd users and groups always in same order
  to avoid republish other packages (boo#944660) 

- cleanup specfile by removing commands that were dealing with systemd
  pre-generated files: we're now using systemd tarball generated directly
  from the git repo which doesn't contain any of these files.
- there's no point in using LUA in %pretrans

- Drop 0009-make-xsltproc-use-correct-ROFF-links.patch
This patch was initialy added to workaround bsc#842844. But it
appears that man(1) was fixed (included since 13.2 at least) to
handle manual pages that consist only of a .so directive such as
'.so <page>'.

- Change use-rndaddentropy-ioctl-to-load-random-seed.patch to
  make it work on big endian

OBS-URL: https://build.opensuse.org/request/show/333777
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=223
2015-09-27 12:32:31 +00:00

46 lines
1.9 KiB
Diff

From: Jeff Mahoney <jeffm@suse.com>
Subject: udev: use device mapper target name for btrfs device ready
References: bnc#888215
When udev gets a change event for a block device, it calls the builtin
btrfs helper to scan it for a btrfs file system. If the file system was
mounted using a device mapper node, mount(8) will have looked up the
device mapper table and used the /dev/mapper/<name> node for mount.
If something like partprobe runs, and then causes change events to be
handled, the btrfs ready event is handled using /dev/dm-N instead of
the device mapper named node. Btrfs caches the last name passed to
the scanning ioctl and uses that to report the device name for
things like /proc/mounts.
So, after running partprobe we go from:
/dev/mapper/test-test on /mnt type btrfs (rw,relatime,space_cache)
... to ...
/dev/dm-0 on /mnt type btrfs (rw,relatime,space_cache)
This doesn't apply only to LVM device, but multipath as well.
If the device is a DM device, udev will have already cached the table name
from sysfs and we can use that to pass /dev/mapper/<name> to the builtin
so that the correct name is used.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
rules/64-btrfs.rules | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: systemd-221/rules/64-btrfs.rules
===================================================================
--- systemd-221.orig/rules/64-btrfs.rules
+++ systemd-221/rules/64-btrfs.rules
@@ -6,7 +6,8 @@ ENV{ID_FS_TYPE}!="btrfs", GOTO="btrfs_en
ENV{SYSTEMD_READY}=="0", GOTO="btrfs_end"
# let the kernel know about this btrfs filesystem, and check if it is complete
-IMPORT{builtin}="btrfs ready $devnode"
+ENV{DM_NAME}=="", IMPORT{builtin}="btrfs ready $devnode"
+ENV{DM_NAME}=="?*", IMPORT{builtin}="btrfs ready /dev/mapper/$env{DM_NAME}"
# mark the device as not ready to be used by the system
ENV{ID_BTRFS_READY}=="0", ENV{SYSTEMD_READY}="0"