use losetup -P instead of kpartx which is racy
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
livecd-rootfs (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[ Impact ]
livefs builds on slow architectures (in particular, riscv64) hit a race with a high degree of frequency when setting up partition maps for the loop-mounted disk image, resulting in a build failure because the partition devices are not available when they need to be.
This race is because 'kpartx -a' invokes kernel APIs that set up the partition mappings asynchronously, returning when the kernel devices exist but not blocking waiting on udev to create the device files under /dev.
In contrast, the newer 'losetup -P' ("--partscan") invokes a syscall that directly sets up the partitions in the kernel as part of the loopback device setup and also creates the device nodes on devtmpfs before returning.
This code has landed in mantic where it has reduced the rate of riscv64 image build failures.
[ Test Plan ]
Unfortunately, since this code landed in mantic, it appears the kernel may have regressed and made losetup -P itself racy (LP: #2045586). Also since it was racy in the first place, a successful build or set of builds would not be evidence that this issue was fixed. So the test plan is restricted to verifying that the autopkgtests pass, and verifying after publication to -updates that daily images are still building.
[ Where problems could occur ]
Getting this working in mantic required changes to launchpad's setup of the build containers wrt /dev mounting. In the unlikely event that the behavior of jammy differed from that of mantic within the build containers, this could cause all jammy livefs builds to fail until resolved.
Changed in livecd-rootfs (Ubuntu): | |
status: | New → Fix Released |
Hello Steve, or anyone else affected,
Accepted livecd-rootfs into jammy-proposed. The package will build now and be available at https:/ /launchpad. net/ubuntu/ +source/ livecd- rootfs/ 2.765.33 in a few hours, and then in the -proposed repository.
Please help us by testing this new package. See https:/ /wiki.ubuntu. com/Testing/ EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification- needed- jammy to verification- done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification- failed- jammy. In either case, without details of your testing we will not be able to proceed.
Further information regarding the verification process can be found at https:/ /wiki.ubuntu. com/QATeam/ PerformingSRUVe rification . Thank you in advance for helping!
N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.