Comment 11 for bug 476654

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

The problem is in force_removal():

| if (device->priv->device_is_mounted && device->priv->device_mount_paths->len > 0)

This condition is fine, udisks properly tracks mounts in fstab.

| {
| gboolean remove_dir_on_unmount;
|
| if (mount_file_has_device (device->priv->device_file, NULL, &remove_dir_on_unmount))

This is the culprit. The mount won't be in /var/lib/udisks/mtab, thus force_unmount() is never called.

| {
| g_print ("**** NOTE: Force unmounting device %s\n", |device->priv->device_file);
| force_unmount (device, callback, user_data);

So there are two options:

 - Don't care about mount_file_has_device() and always clean up stale mounts. This is certainly a valid approach, and I don't see the value of keeping around stale mounts, but there might be cases, or simply a definition, that udisks shouldn't interfere with mounts at all that it didn't mount in the first place.

 - Add alternative check if fstab has the device.

I'd go with the second approach for now.