summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2016-02-19 12:14:30 +0100
committerOndrej Holy <oholy@redhat.com>2016-02-29 13:03:45 +0100
commitba397fa918250cee436e1cfd5fd5049b4ee42068 (patch)
tree5d968c79f97f8f2c7ef1679592cdb9f82177e5a4
parente1c7c568a25392e7994efcd7e2d741ef90db7a9b (diff)
downloadgvfs-ba397fa918250cee436e1cfd5fd5049b4ee42068.tar.gz
udisks2: Send unmount notification only once when stopping
Unmount notification is sent for each volume when stopping drive, which is wrong. It may lead to data loss, because user may unplug the device after the first notification, before the device is really stopped. It should be handled similary as an eject operation and send the notification only once for the drive. https://bugzilla.gnome.org/show_bug.cgi?id=760523
-rw-r--r--monitor/udisks2/gvfsudisks2mount.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/monitor/udisks2/gvfsudisks2mount.c b/monitor/udisks2/gvfsudisks2mount.c
index af91a38a..29f2a3d5 100644
--- a/monitor/udisks2/gvfsudisks2mount.c
+++ b/monitor/udisks2/gvfsudisks2mount.c
@@ -601,7 +601,8 @@ unmount_data_complete (UnmountData *data,
gboolean complete_idle)
{
if (data->mount_operation &&
- !unmount_operation_is_eject (data->mount_operation))
+ !unmount_operation_is_eject (data->mount_operation) &&
+ !unmount_operation_is_stop (data->mount_operation))
gvfs_udisks2_unmount_notify_stop (data->mount_operation, data->failed);
if (complete_idle)