[21.04 regression] formatting vfat times out

Bug #1925822 reported by Martin Pitt
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
udisks2 (Ubuntu)
Fix Released
High
Sebastien Bacher
Hirsute
Fix Released
Undecided
Unassigned

Bug Description

* Impact

Formatting devices to vfat fails in some cases due to an incompatibility with the new dosfstools version

* Test case

see comment #5

or

- $ sudo modprobe scsi_debug
- check what device is assigned
- $ sudo busctl call org.freedesktop.UDisks2 /org/freedesktop/UDisks2/block_devices/DEVNAME org.freedesktop.UDisks2.Block Format 'sa{sv}' vfat 0
(replace DEVNAME by the actual device name, 'sdc' for example)

the formatting should work which you can verify by
- $ blkid -p /dev/DEVNAME

* Regression potential

The changes is specific to vfat handling so that's the feature to focus on while testing, make sure than creating, deleting, renaming vfat partitions from gnome-disks is working.

[racb] An upstream "precautionary" partprobe is being added following the mkfs for vfat, when it didn't do this before. This is a change in behaviour that might expose a problem elsewhere.

----------------------------

There is a regression somewhere between udisks, udev, and dosfstools. Formatting a device with vfat hangs and fails:

# blkid -p /dev/sda
(nothing)

# busctl call org.freedesktop.UDisks2 /org/freedesktop/UDisks2/block_devices/sda org.freedesktop.UDisks2.Block Format 'sa{sv}' vfat 0
(long pause)
Call failed: Error synchronizing after formatting with type `vfat': Timed out waiting for object

# blkid -p /dev/sda
/dev/sda: PTUUID="3690494f" PTTYPE="dos"

OTOH, formatting as ext4 works fine:

# wipefs -a /dev/sda; wipefs -a /dev/sda
# busctl call org.freedesktop.UDisks2 /org/freedesktop/UDisks2/block_devices/sda org.freedesktop.UDisks2.Block Format 'sa{sv}' ext4 0
(immediately succeeds)

# blkid -p /dev/sda
/dev/sda: UUID="8bea7475-6af5-4835-86d0-0e5b2cb5500e" VERSION="1.0" BLOCK_SIZE="4096" TYPE="ext4" USAGE="filesystem"

I tested this to a QEMU emulated disk, but it reproduces equally well against a `modprobe scsi_debug` device.

Package: udisks2 2.9.2-1
DistroRelease: Ubuntu 21.04

Revision history for this message
Martin Pitt (pitti) wrote :

Forgot to mention, there is nothing useful in the journal. The only message is this when the timeout happens:

Apr 23 15:12:35 ubuntu udisksd[3116]: Error synchronizing after formatting with type `vfat': Timed out waiting for object

description: updated
Revision history for this message
Martin Pitt (pitti) wrote :

I tried to run it in the foreground with

  G_MESSAGES_DEBUG=all /usr/libexec/udisks2/udisksd

but still no messages aside from the timeout.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Hey Martin, thank you for the report!

Could you try if using directly the mkfs command is working?
$ sudo mkfs.vfat -I -n label /dev/sdc

I guess you checked the journal for clues?

The command you provided works fine on my hirsute system to format an usb key in vfat, I'm not sure if the type of device could make a difference there...

Changed in udisks2 (Ubuntu):
status: New → Incomplete
Revision history for this message
Sebastien Bacher (seb128) wrote :

Adding as a note that there were recent discussions around vfat and dosfstools in https://github.com/storaged-project/udisks/issues/851 but that was fixed in https://launchpad.net/ubuntu/+source/libblockdev/2.25-2

Revision history for this message
Martin Pitt (pitti) wrote :

Reproducer from scratch:

# download current cloud image
curl -L -O https://cloud-images.ubuntu.com/daily/server/hirsute/current/hirsute-server-cloudimg-amd64.img
# nothing fancy, just admin:foobar and root:foobar
curl -L -O https://github.com/cockpit-project/bots/raw/master/machine/cloud-init.iso
# create second disk image for formatting
qemu-img create -f qcow2 disk2.img 100M
# boot it
qemu-system-x86_64 -cpu host -enable-kvm -nographic -m 2048 -drive file=hirsute-server-cloudimg-amd64.img,if=virtio -snapshot -cdrom cloud-init.iso -drive file=disk2.img,if=virtio

Log in on the console (root:foobar), then

# sanity check: should be empty
blkid -p /dev/vdb

busctl call org.freedesktop.UDisks2 /org/freedesktop/UDisks2/block_devices/vdb org.freedesktop.UDisks2.Block Format 'sa{sv}' vfat 0

→ hangs.

Revision history for this message
Martin Pitt (pitti) wrote :

Direct mkfs works:

# mkfs.vfat -I -n label /dev/vdb
mkfs.fat 4.2 (2021-01-31)
mkfs.fat: Warning: lowercase labels might not work properly on some systems
# blkid -p /dev/vdb
/dev/vdb: PTUUID="892240dd" PTTYPE="dos"

Changed in udisks2 (Ubuntu):
status: Incomplete → New
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks Martin, I can confirm that now, interesting that it happens there but not on an usb stick though

Changed in udisks2 (Ubuntu):
importance: Undecided → High
status: New → Confirmed
Changed in udisks2 (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Sebastien Bacher (seb128) wrote :

Alright, it's an incompatibility issue with dosfstools 4.2, downgrading to 4.1 fixes the issue.

Checking upstream the issue was fixed by https://github.com/storaged-project/udisks/commit/ef1979d8 which I've backported now and verify is working

SRU is in the hirsute queue

description: updated
Changed in udisks2 (Ubuntu):
assignee: nobody → Sebastien Bacher (seb128)
Revision history for this message
Martin Pitt (pitti) wrote :

Argh indeed, forgot about that one already -- I even looked at that before, it's tracked here: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=983751

But you knew that as well, in comment #4 -- So I hope this didn't take too much time to track down. Merci beaucoup !

Revision history for this message
Robie Basak (racb) wrote : Please test proposed package

Hello Martin, or anyone else affected,

Accepted udisks2 into hirsute-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/udisks2/2.9.2-1ubuntu1 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-hirsute to verification-done-hirsute. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-hirsute. 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/PerformingSRUVerification . 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.

description: updated
Changed in udisks2 (Ubuntu Hirsute):
status: New → Fix Committed
tags: added: verification-needed verification-needed-hirsute
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (udisks2/2.9.2-1ubuntu1)

All autopkgtests for the newly accepted udisks2 (2.9.2-1ubuntu1) for hirsute have finished running.
The following regressions have been reported in tests triggered by the package:

gvfs/1.47.91-1ubuntu1 (arm64)
clevis/16-1 (s390x)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/hirsute/update_excuses.html#udisks2

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Martin Pitt (pitti) wrote :

I installed udisks2 2.9.2-1ubuntu1 from hirsute-proposed, and confirm that both the manual test case above as well as cockpit's automatic TestStorageFormat.testFormatTypes now succeed. Thank you Sebastien and Robie!

tags: added: verification-done verification-done-hirsute
removed: verification-needed verification-needed-hirsute
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

What about impish? I know this fix is upstream and will eventually get released, but do we know when? I would at least like to know that before proceeding with the release of this into hirsute-updates.

Revision history for this message
Sebastien Bacher (seb128) wrote :

@Łukasz we started working on merges, that one will probably land in impish next week at this point and we will include the SRU changes. I could try to find time today though if that's a prerequire to validate the SRU

Revision history for this message
Brian Murray (brian-murray) wrote :

Per the Stable Release Updates policy it is a general rule that the bug be fixed in the development release of Ubuntu before releasing it as an SRU. So that's why sil2100 and raof have both asked about the status of this for impish. Adding information about the plan for impish to the bug description might have avoided some of these questions.

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Procedure

Revision history for this message
Sebastien Bacher (seb128) wrote :

@Brian, the SRU team used to be more understanding about such cases and we even had SRU pocket copied forward in the past at the beginning of a cycle... it's a bit unfortunate that despite having commented twice now on different bugs to say that the merge would happen this week we are still having the SRU not moved

Revision history for this message
Sebastien Bacher (seb128) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package udisks2 - 2.9.2-2ubuntu1

---------------
udisks2 (2.9.2-2ubuntu1) impish; urgency=medium

  * debian/patches/git_dosfstools_4.2.patch:
  * debian/patches/git_dosfstools_4.2-reread_part.patch:
    - cherrypick commits to improve the compatibility with dosfstools 4.2
      fix the formatting of vfat devices (lp: #1925822)
  * debian/patches/git_exfatprogs_compat.patch:
    - create exfat filesystems in a way that is compatible with exfatprogs
      (lp: #1924888)

 -- Sebastien Bacher <email address hidden> Thu, 20 May 2021 11:35:08 +0200

Changed in udisks2 (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package udisks2 - 2.9.2-1ubuntu1

---------------
udisks2 (2.9.2-1ubuntu1) hirsute; urgency=medium

  * debian/patches/git_dosfstools_4.2.patch:
  * debian/patches/git_dosfstools_4.2-reread_part.patch:
    - cherrypick commits to improve the compatibility with dosfstools 4.2
      fix the formatting of vfat devices (lp: #1925822)
  * debian/patches/git_exfatprogs_compat.patch:
    - create exfat filesystems in a way that is compatible with exfatprogs
      (lp: #1924888)

 -- Sebastien Bacher <email address hidden> Tue, 27 Apr 2021 10:16:27 +0200

Changed in udisks2 (Ubuntu Hirsute):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for udisks2 has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.