- 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.
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.
| { dir_on_ unmount; file_has_ device (device- >priv-> device_ file, NULL, &remove_ dir_on_ unmount) )
| gboolean remove_
|
| if (mount_
This is the culprit. The mount won't be in /var/lib/ udisks/ mtab, thus force_unmount() is never called.
| { >priv-> device_ file);
| g_print ("**** NOTE: Force unmounting device %s\n", |device-
| 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.