[BUG? NVME Linux-4.15] Dracut loops indefinitely with 4.15

From: Julien Durillon
Date: Thu Feb 15 2018 - 08:50:23 EST


Hi there,

I opened an issue here:
https://github.com/dracutdevs/dracut/issues/373 for dracut. You can
read there how dracuts enters an infinite loop.

TL;DR: in linux-4.14, trying to find the last "slave" of /dev/dm-0
ends with a maj:min of "249:0" which does not exist in /sys/dev/block.
In linux-4.15, the same thing loops as "249:0" exists.

## My configuration

I'm using a nvme ssd disk named "nvme0n1". It has two partitions: an
EFI one and a luks encrypted btrfs volume. So in /dev I have /dev/dm-0
that is referenced to by /dev/mapper/root.
/dev/mapper/root -> /dev/dm-0 is the mapped un-encrypted
"/dev/nvme0n1p2" volume used as a btrfs volume.

## My problem

*Before* linux-4.15, `stat /dev/dm-0` displays:

File: /dev/dm-0
Size: 0 Blocks: 0 IO Block: 4096 block special file
Device: 6h/6d Inode: 2768 Links: 1 Device type: fa,0
Access: (0660/brw-rw----) Uid: ( 0/ root) Gid: ( 6/ disk)
Access: 2018-02-12 17:49:46.020513274 +0100
Modify: 2018-02-12 17:49:46.020513274 +0100
Change: 2018-02-12 17:49:46.020513274 +0100
Birth: -

So the device type is "fa,0", which is translated by dracut as "250:0".

*Starting at* linux-4.15, `stat /dev/dm-0` displays:

File: /dev/dm-0
Size: 0 Blocks: 0 IO Block: 4096 block special file
Device: 6h/6d Inode: 17795 Links: 1 Device type: f9,0
Access: (0660/brw-rw----) Uid: ( 0/ root) Gid: ( 6/ disk)
Access: 2018-02-15 14:38:56.570529189 +0100
Modify: 2018-02-15 14:38:56.570529189 +0100
Change: 2018-02-15 14:38:56.570529189 +0100
Birth: -

So the device type is "f9,0", which is translated by dracut as "249:0".

I'm posting it here because I don't understand why the kernel changed
the device type. Is it intended?

Regards,
--
Julien Durillon