On Tue, Apr 09, 2024 at 01:33:13PM +0200, Sven wrote: > Hi, > > I'm using dm-init to set up a dm-verity rootfs, i.e. my kernel command line > includes: > > root=/dev/dm-0 > dm-mod.waitfor=/dev/mmcblk0p3 > dm-mod.create="rootfs,,0,ro,0 614400 verity 1 /dev/mmcblk0p3 /dev/mmcblk0p3 > 1024 4096 307200 76801 sha256 HASH HASH" > > Occasionally, my device refuses to boot with the following errors: > > device-mapper: table: 254:0: verity: Data device lookup failed (-ENXIO) > device-mapper: ioctl: error adding target to table > > There appears to be a race condition somewhere. This problem started to > appear when updating from kernel version 5.15.148 to 6.6.22. Looking at the > changes between the versions, this patch seems relevant: > https://lore.kernel.org/all/20230531125535.676098-19-hch@xxxxxx/ > > It appears that early_lookup_bdev in dm_init_init would succeed even if the > partition block device is not there yet but the parent block device is. > Could that explain why the subsequent device lookup for the partition > fails? -ENXIO isn't really an error that should come from the early block device lookup. On the other hand mmc_blk_open can return -ENXIO and block device open return values end up here. Can you throw a printk or trace probe of your choice into mmc_blk_open to see if that's the culprit?