On Wed, 15 Nov 2023, Mike Snitzer wrote:

> On Wed, Nov 15 2023 at  2:01P -0500,
> Aaditya Raj Barnwal <[email protected]> wrote:
> 
> > Sorry if that statement confused you ,  It was debugging print 
> > that was added to check if the  tight while loop has ended or not
> >  
> > Code : dm-init.c 
> > dm_init_init()
> >  
> >     wait_for_device_probe();
> >     for (i = 0; i < ARRAY_SIZE(waitfor); i++) {
> >             if (waitfor[i]) {
> >                     dev_t dev;
> >  
> >                     DMERR("waiting for device %s ...", waitfor[i]);
> >                     while ((dev=  name_to_dev_t(waitfor[i]) !=0))
> >                             fsleep(5000);
> >             }
> >  
> >     DMERR("exiting after %s ",waitfor[i]);  <<<<<<<<<<<here it was added 
> >     }
> >  
> >     if (waitfor[0])
> >             DMINFO("all devices available");
> >  
> >     list_for_each_entry(dev, &devices, list) {
> >             if (dm_early_create(&dev->dmi, dev->table,
> >                                 dev->target_args_array))
> >                     break;
> >     }
> > 
> 
> 
> Mikulas wasn't confused.  He was pointing out that you have made
> changes to your kernel without sharing what they are.
> 
> But your issue is that you configured the dm-mod.waitfor device
> incorrectly. You must wait for the underlying physical device(s) that
> the virtual DM device depends on.

Yes, that's the problem.

> Mike

[    9.785204][    T9] mmc0: CQHCI version 5.10
[    9.826746][    T9] mmc0: SDHCI controller on 8804000.sdhci [8804000.sdhci] 
using ADMA 64-bit
[    9.835559][    T9] sdhci_msm 8804000.sdhci: mmc0: CQE init: success
[    9.842578][    T1] device-mapper: init: waiting for device /dev/dm-0 ...
[    9.849605][    T1] device-mapper: init:  exiting after  /dev/dm-0 <<<<<got  
dev/dm-0
[    9.856689][    T1] device-mapper: init: all devices available
[    9.863061][    T1] device-mapper: table: 252:0: verity: Data device lookup 
failed
[    9.870868][    T1] device-mapper: ioctl: error adding target to table
[    9.895539][   T37]

I'm wondering about another thing - here it succeeds finding /dev/dm-0 and 
immediatelly after that fails loading /dev/dm-0 table with the dm-verity 
target.

So, how could we succeed finding /dev/dm-0 before it was created?

I think that you backported that patch incorrectly - instead of

        while ((dev=  name_to_dev_t(waitfor[i]) !=0)) fsleep(5000);

there should be

        while ((dev=  name_to_dev_t(waitfor[i]) ==0)) fsleep(5000);

There was a change in the return value of devt_from_devname - in 6.7-rc1, 
it returns 0 on success and -ERROR on error. In 5.15.104, it returns 0 on 
error and a device nubmer on success.

Mikulas


Reply via email to