[Bug 2045797] Re: use losetup -P instead of kpartx which is racy

Launchpad Bug Tracker 2045797 at bugs.launchpad.net
Wed Jan 17 11:44:47 UTC 2024


This bug was fixed in the package livecd-rootfs - 2.765.34

---------------
livecd-rootfs (2.765.34) jammy; urgency=medium

  * Remove comments in the debian/control dependencies as it was causing the
    package build to fail.

livecd-rootfs (2.765.33) jammy; urgency=medium

  [ Steve Langasek ]
  * Use losetup instead of kpartx to resolve race conditions in riscv64
    image builds.  LP: #2045797.

  [ Utkarsh Gupta ]
  * unminimize: Use lxd-installer to install LXD itself (LP: #2036725)

livecd-rootfs (2.765.32) jammy; urgency=medium

  [ Heinrich Schuchardt ]
  * arm: fix console parameter for ARM cloud-images (LP: #2036730)

livecd-rootfs (2.765.31) jammy; urgency=medium

  [ John Chittum ]
  * fix: add 6.5 kernel apparmor features to livecd-rootfs based on
    features of 6.5 in ubuntu/mantic. This will roll as HWE. (LP: #2037567)

livecd-rootfs (2.765.30) jammy; urgency=medium

  * Enable snap preseeding with ppc64el images where /boot/vmlinux is used
    instead of /boot/vmlinuz. (LP: #2038957)

livecd-rootfs (2.765.29) jammy; urgency=medium

  [ Steve Langasek ]
  * The chroot tmpfs mount should only be /var/lib/apt/lists, not
    /var/lib/apt; the latter breaks changes to /var/lib/apt/extended_states.
    (LP: #2036195).

livecd-rootfs (2.765.28) jammy; urgency=medium

  * Fix unminimize to correctly list packages. (LP: #1996489)
  * Install LXD snap from stable/ubuntu-<version> channel. (LP: #2036725)

livecd-rootfs (2.765.27) jammy; urgency=medium

  [ Thomas Bechtold ]
  * Do not modify /etc/ssh/sshd_config for ubuntu-cpc
    project builds (LP: #1968873)

 -- Ɓukasz 'sil2100' Zemczak <lukasz.zemczak at ubuntu.com>  Mon, 15 Jan
2024 16:41:18 +0100

** Changed in: livecd-rootfs (Ubuntu Jammy)
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to livecd-rootfs in Ubuntu.
https://bugs.launchpad.net/bugs/2045797

Title:
  use losetup -P instead of kpartx which is racy

Status in livecd-rootfs package in Ubuntu:
  Fix Released
Status in livecd-rootfs source package in Jammy:
  Fix Released

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/livecd-rootfs/+bug/2045797/+subscriptions




More information about the foundations-bugs mailing list