Unmount is broken

Bug #1789922 reported by Phillip Susi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
udisks
Fix Released
Unknown
gnome-disk-utility (Ubuntu)
Invalid
Undecided
Unassigned
udisks2 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Try to unmount or resize an ext4 partition with the gnome disks utility. It throws an error saying it can't unmount the filesystem because it isn't mounted. This is on 18.04.

Revision history for this message
Phillip Susi (psusi) wrote :

Actually it looks like it's gnome-disk-utility that does the unmount and throws the error. I can't for the life of me figure out this rat nest of code though. In gduresizedialog.c, resize() calls gdu_utils_ensure_unused() and passes it unmount_cb(), which appears to be what is throwing that error message after the unmount fails. What I can't see is where the actual unmount is done. gdu_utils_ensure_unused() appears to call g_task_new to set up a task to invoke that callback after the task itself as run, but I see no call to g_task_run_in_thread() which would actually specify the task function to run, and make it run.

affects: udisks2 (Ubuntu) → gnome-disk-utility (Ubuntu)
Revision history for this message
Phillip Susi (psusi) wrote :

So I ran it under gdb and set a breakpoint to find how unmount_cb() is being called and traced the problem back up to unuse_data_iterate(). It calls gdu_utils_is_in_use_full(), which incorrectly identifies the mount point of the filesystem as "/". So it looks like either it is finding the wrong mount point for the filesystem and trying to unmount the root ( which you obviously can't do ), or unuse_data_iterate() is actually being called on the root filesystem instead of the one you are trying to resize. Unfortunately I can't tell which since almost all of the data this code is working with gdb tells me has an incomplete type.

Revision history for this message
Phillip Susi (psusi) wrote :

Man this cold must really be messing with my head. I had the wrong drive selected and actually was trying to resize the root partition.

Changed in gnome-disk-utility (Ubuntu):
status: New → Invalid
Revision history for this message
Phillip Susi (psusi) wrote :

Nevermind, it still doesn't work on the right disk. While the disk is not mounted initially, by the time unuse_data_iterate() is called, it has been mounted for some reason. I'm thinking there is a race condition where something mounts the fs temporarily and unmounts it, and during the time it is mounted is when unuse_data_iterate() is called, which sees it is mounted, and tries to unmount it, but by the time the unmount request goes through, it has already been unmounted.

Changed in gnome-disk-utility (Ubuntu):
status: Invalid → New
Revision history for this message
Phillip Susi (psusi) wrote :

It turns out that just trying to unmount an fs is broken. Apparently resize mounts the fs first for some reason, then when it tries to unmount, it can't.

summary: - Resize is broken
+ Unmount is broken
description: updated
Revision history for this message
Phillip Susi (psusi) wrote :

Upstream concluded that the bug lies in udisks. It needs a similar fix to one it got before to wait for the changes to propagate before returning from resize. Unmount needs a similar waiter.

Changed in gnome-disk-utility (Ubuntu):
status: New → Invalid
Changed in udisks:
status: Unknown → Fix Released
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.