[gnome-disk-utility] Fix unmounting and probing of mounted volumes



commit 92e512b03645b998414a51d7ebc76febd2316525
Author: Kai Lüke <kailueke riseup net>
Date:   Tue Apr 11 12:45:57 2017 +0200

    Fix unmounting and probing of mounted volumes
    
    Everytime all volumes of a device were to be umounted
    (e.g. in order to eject the device) the LUKS partitions
    have not been closed due to a bug. Also the benchmark
    dialog preselected the write option for every device but
    was supposed to do this only for unused devices.
    This is because of broken code in gdu_utils_is_in_use_full
    which always returned FALSE or TRUE depending on whether a
    pointer was passed in filesystem_to_unmount_out and also its
    code to set encrypted_to_lock_out was never executed then
    and gdu_utils_is_in_use always returned FALSE.
    
    After repairing the code the iterative umounting of all
    mounted volumes works again and the write option in the
    benchmark is only preselected for unmounted devices.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=780865

 src/libgdu/gduutils.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/libgdu/gduutils.c b/src/libgdu/gduutils.c
index ee29af8..16640bc 100644
--- a/src/libgdu/gduutils.c
+++ b/src/libgdu/gduutils.c
@@ -980,6 +980,7 @@ gdu_utils_is_in_use_full (UDisksClient      *client,
           if (g_strv_length ((gchar **) mount_points) > 0)
             {
               filesystem_to_unmount = g_object_ref (filesystem_for_object);
+              ret = TRUE;
               goto victim_found;
             }
         }
@@ -993,6 +994,7 @@ gdu_utils_is_in_use_full (UDisksClient      *client,
             {
               g_object_unref (cleartext);
               encrypted_to_lock = g_object_ref (encrypted_for_object);
+              ret = TRUE;
               goto victim_found;
             }
         }
@@ -1004,13 +1006,11 @@ gdu_utils_is_in_use_full (UDisksClient      *client,
     {
       *filesystem_to_unmount_out = (filesystem_to_unmount != NULL) ?
         g_object_ref (filesystem_to_unmount) : NULL;
-      ret = TRUE;
     }
-  else if (encrypted_to_lock_out != NULL)
+  if (encrypted_to_lock_out != NULL)
     {
       *encrypted_to_lock_out = (encrypted_to_lock != NULL) ?
         g_object_ref (encrypted_to_lock) : NULL;
-      ret = TRUE;
     }
 
   g_clear_object (&partition_table);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]