Performing verification for Jammy.

I started a fresh VM, with 5.15.0-101-generic from updates. I ran the
following reproducer:

$ fallocate -l 1G /tmp/blob
$ LOOPDEV=$(sudo losetup --find --show /tmp/blob)
$ sudo /usr/sbin/parted -s -m -a optimal $LOOPDEV -- unit KiB mklabel gpt 
mkpart primary 0% 100%
Error: Partition(s) 1 on /dev/loop4 have been written, but we have been unable 
to inform the kernel of the change, probably because it/they are in use.  As a 
result, the old partition(s) will remain in use.  You should reboot now before 
making further changes.

I then enabled -proposed, and installed 5.15.0-102-generic:

$ uname -rv
5.15.0-102-generic #112-Ubuntu SMP Tue Mar 5 16:50:32 UTC 2024

Running the reproducer:

$ fallocate -l 1G /tmp/blob
$ LOOPDEV=$(sudo losetup --find --show /tmp/blob)
$ sudo /usr/sbin/parted -s -m -a optimal $LOOPDEV -- unit KiB mklabel gpt 
mkpart primary 0% 100%

$ losetup -a
/dev/loop4: []: (/tmp/blob)
$ ll /dev
...
brw-rw----  1 root disk      7,   4 Mar 19 03:45 loop4
brw-rw----  1 root disk    259,   0 Mar 19 03:45 loop4p1
...

Things are now working as intended. The kernel in -proposed solves the
issue. Happy to mark verified for Jammy.

** Tags removed: verification-needed-jammy-linux
** Tags added: sts verification-done-jammy-linux

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/2056143

Title:
  block/loop: No longer allows to create partitions

Status in linux package in Ubuntu:
  Invalid
Status in linux source package in Jammy:
  Fix Committed

Bug description:
  == SRU Justification ==

  -- Impact --
  In 22.04/Jammy with the GA 5.15 kernel there was an upstream change 
preventing partition table operations when GENHD_FL_NO_PART is set.
   1a721de8489f "block: don't add or resize partition on the disk with 
GENHD_FL_NO_PART"
  Beside of changing return codes and breaking some user-space that way this 
also causes loop block devices to no longer be able to have partitions manually 
created. This is because the loop block driver uses GENHD_FL_NO_PART to prevent 
active partition scans.

  -- Fix --
  This was changed in 5.19 (and thus Mantic is not affected) by introducing a 
separate flag to prevent those scans:
   b9684a71fca7 "block, loop: support partitions without scanning"
  The fix depends on a larger rewrite so it cannot be simply picked. The 
biggest change from the original is moving the check for the new flag into a 
helper function in genhd.h which checks whether a disk should be scanned for 
partitions. That function was dropped with the upstream rewrite and checking 
moved into the loop driver directly. But it felt like adjusting the helper was 
the better approach.

  Note: The upstream patch has a follow-up change submitted:
    748008e1da92 "block: don't add partitions if GD_SUPPRESS_PART_SCAN is set"
  We do _NOT_ need that in Jammy/5.15 because block/partitions/core.c:
  blk_add_partitions() checks disk_part_scan_enabled() which was where we added 
the check for the backport instead of modifying disk_scan_partitions() directly.

  -- Testcase --
  $ fallocate -l 1G /tmp/blob
  $ LOOPDEV=$(sudo losetup --find --show /tmp/blob)
  $ sudo /usr/sbin/parted -s -m -a optimal $LOOPDEV -- unit KiB mklabel gpt 
mkpart primary 0% 100%

  -- Regression Potential --
  If things go wrong it might be other devices which no longer get scanned 
automatically or other issues with the loop block driver.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2056143/+subscriptions


-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to