btrfs-progs: udev: add rules for dm devices
commit550b508129f26940790ddb82f00a5412b37e8741
authorJeff Mahoney <jeffm@suse.com>
Mon, 9 May 2016 15:44:26 +0000 (9 11:44 -0400)
committerDavid Sterba <dsterba@suse.com>
Thu, 19 May 2016 12:21:43 +0000 (19 14:21 +0200)
tree06cb204f4798c45dfc4b4d26be475252c65febd1
parent53ce30cd7c9c177c2897bb40ef252d5070f9876d
btrfs-progs: udev: add rules for dm devices

Systemd's btrfs rule runs btrfs dev ready on each device
as it's discovered.  The btrfs command is executed as a builtin
command via an IMPORT{builtin} rule, which means it gets
executed at rule evaluation time, not rule execution time.  That
means that the device mapper links haven't been setup yet and the only
nodes that can be depended upon are /dev/dm-#.  That we see
/dev/mapper/name names in /proc/mounts is only because we replace the
device name we have cached with the one passed in via mount.  If
we have a multi-device file system and the primary device is removed,
the remaining devices will show /dev/dm-#.  In addition, if the
udev rule is executed again by someone generating a change event (e.g.
partprobe), the names are also replaced by the /dev/dm-# names.

This patch adds a new rule that adds a run rule that calls btrfs dev
ready again using the device mapper links once they're created.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
64-btrfs-dm.rules [new file with mode: 0644]
Makefile.in
configure.ac