[gvfs] Ignore drives without volumes



commit d51ca4c383628ff06fbd37a1a3622d394ddfc0d5
Author: David Zeuthen <davidz redhat com>
Date:   Sat Apr 11 12:43:06 2009 -0400

    Ignore drives without volumes
    
    This fixes a problem on some dmraid setups where we have drives
    without any partitions (the dmraid boot scripts removes all partitions
    (!)). See https://bugzilla.redhat.com/show_bug.cgi?id=495152 for more
    details.
    
    This fix is also consistent with the policy of ignoring drives where
    all volumes are ignored. E.g. prior to this patch we didn't shown
    neither sdb if sdb1 was a the only unrecognized partition on sdb.. so
    if you delete sdb1, it would be natural to keep hiding sdb (which is
    what this patch does).
---
 monitor/gdu/ggduvolumemonitor.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/monitor/gdu/ggduvolumemonitor.c b/monitor/gdu/ggduvolumemonitor.c
index 9ecee8b..0e7ce6f 100644
--- a/monitor/gdu/ggduvolumemonitor.c
+++ b/monitor/gdu/ggduvolumemonitor.c
@@ -799,7 +799,13 @@ should_drive_be_ignored (GduPool *pool, GduDrive *d, GList *fstab_mount_points)
         }
     }
 
-  ret = has_volumes && all_volumes_are_ignored;
+  /* we ignore a drive if
+   *
+   * a) it doesn't have any volumes; or
+   *
+   * b) the volumes of the drive are all ignored
+   */
+  ret = (!has_volumes) || (has_volumes && all_volumes_are_ignored);
 
  out:
   g_list_foreach (enclosed, (GFunc) g_object_unref, NULL);



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