On Fri, Apr 12, 2024 at 11:13:27AM +0200, Sven wrote: > Hi again, > > I have found out some more about this issue: > > When dm-init succeeds in finding /dev/mmcblk0p3, it actually only finds > /dev/mmcblk0 and NOT the partition block device (see behavior in > devt_from_devname). > > Subsequently, when dm-verity looks up the data device (/dev/mmcblk0p3) via > dm_get_device, the following call stack is executed: > > dm_get_device > dm_get_table_device > open_table_device > blkdev_get_by_dev > blkdev_get_no_open > > blkdev_get_no_open actually returns -ENXIO because the partition device is > not available yet. That error then propagates back. > > A naive fix that works for me follows: Yea, the early lookup behavior is weird. But it also dates back a long time, so I'm not sure this changed, except for maybe timings? If you go down the device open route it should us the kernel open routins and not just the not open ones. That being said the right fix is to not use this code at all, which was only shoe horned together and doesn't have a chance to work solidly and just wait for the device in userspace because we do have reliably udev events there.