Blob Blame History Raw
From 9a265228542de72df41caef8bd31402841ac389c Mon Sep 17 00:00:00 2001
From: David Zeuthen <davidz@redhat.com>
Date: Sat, 11 Apr 2009 12:43:06 -0400
Subject: [PATCH] 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);
-- 
1.6.2.2