|
Tomas Bzatek |
920f2d4 |
From dfa4b522b5c19c4723004baab3e54592f9875597 Mon Sep 17 00:00:00 2001
|
|
Tomas Bzatek |
920f2d4 |
From: David Zeuthen <davidz@redhat.com>
|
|
Tomas Bzatek |
920f2d4 |
Date: Thu, 1 Oct 2009 16:49:32 -0400
|
|
Tomas Bzatek |
920f2d4 |
Subject: [PATCH] =?UTF-8?q?Bug=20597041=20=E2=80=93=20Manual=20umount=20triggers=20mount=20request?=
|
|
Tomas Bzatek |
920f2d4 |
MIME-Version: 1.0
|
|
Tomas Bzatek |
920f2d4 |
Content-Type: text/plain; charset=UTF-8
|
|
Tomas Bzatek |
920f2d4 |
Content-Transfer-Encoding: 8bit
|
|
Tomas Bzatek |
920f2d4 |
|
|
Tomas Bzatek |
920f2d4 |
We also need to consider logical partitions when determining if a
|
|
Tomas Bzatek |
920f2d4 |
drive should be ignored.
|
|
Tomas Bzatek |
920f2d4 |
---
|
|
Tomas Bzatek |
920f2d4 |
monitor/gdu/ggduvolumemonitor.c | 41 ++++++++++++++++++++++++++++++++++++++-
|
|
Tomas Bzatek |
920f2d4 |
1 files changed, 40 insertions(+), 1 deletions(-)
|
|
Tomas Bzatek |
920f2d4 |
|
|
Tomas Bzatek |
920f2d4 |
diff --git a/monitor/gdu/ggduvolumemonitor.c b/monitor/gdu/ggduvolumemonitor.c
|
|
Tomas Bzatek |
920f2d4 |
index ac90ba4..83d8fc2 100644
|
|
Tomas Bzatek |
920f2d4 |
--- a/monitor/gdu/ggduvolumemonitor.c
|
|
Tomas Bzatek |
920f2d4 |
+++ b/monitor/gdu/ggduvolumemonitor.c
|
|
Tomas Bzatek |
920f2d4 |
@@ -871,7 +871,7 @@ should_drive_be_ignored (GduPool *pool, GduDrive *d, GList *fstab_mount_points)
|
|
Tomas Bzatek |
920f2d4 |
|
|
Tomas Bzatek |
920f2d4 |
/* never ignore a drive if it has volumes that we don't want to ignore */
|
|
Tomas Bzatek |
920f2d4 |
enclosed = gdu_pool_get_enclosed_presentables (pool, GDU_PRESENTABLE (d));
|
|
Tomas Bzatek |
920f2d4 |
- for (l = enclosed; l != NULL; l = l->next)
|
|
Tomas Bzatek |
920f2d4 |
+ for (l = enclosed; l != NULL && all_volumes_are_ignored; l = l->next)
|
|
Tomas Bzatek |
920f2d4 |
{
|
|
Tomas Bzatek |
920f2d4 |
GduPresentable *enclosed_presentable = GDU_PRESENTABLE (l->data);
|
|
Tomas Bzatek |
920f2d4 |
|
|
Tomas Bzatek |
920f2d4 |
@@ -879,6 +879,7 @@ should_drive_be_ignored (GduPool *pool, GduDrive *d, GList *fstab_mount_points)
|
|
Tomas Bzatek |
920f2d4 |
if (GDU_IS_VOLUME (enclosed_presentable))
|
|
Tomas Bzatek |
920f2d4 |
{
|
|
Tomas Bzatek |
920f2d4 |
GduVolume *volume = GDU_VOLUME (enclosed_presentable);
|
|
Tomas Bzatek |
920f2d4 |
+ GduDevice *volume_device;
|
|
Tomas Bzatek |
920f2d4 |
|
|
Tomas Bzatek |
920f2d4 |
have_volumes = TRUE;
|
|
Tomas Bzatek |
920f2d4 |
|
|
Tomas Bzatek |
920f2d4 |
@@ -887,6 +888,44 @@ should_drive_be_ignored (GduPool *pool, GduDrive *d, GList *fstab_mount_points)
|
|
Tomas Bzatek |
920f2d4 |
all_volumes_are_ignored = FALSE;
|
|
Tomas Bzatek |
920f2d4 |
break;
|
|
Tomas Bzatek |
920f2d4 |
}
|
|
Tomas Bzatek |
920f2d4 |
+
|
|
Tomas Bzatek |
920f2d4 |
+ /* The volume may be an extended partition - we need to check all logical
|
|
Tomas Bzatek |
920f2d4 |
+ * partitions as well (#597041)
|
|
Tomas Bzatek |
920f2d4 |
+ */
|
|
Tomas Bzatek |
920f2d4 |
+ volume_device = gdu_presentable_get_device (GDU_PRESENTABLE (volume));
|
|
Tomas Bzatek |
920f2d4 |
+ if (volume_device != NULL)
|
|
Tomas Bzatek |
920f2d4 |
+ {
|
|
Tomas Bzatek |
920f2d4 |
+ if (g_strcmp0 (gdu_device_partition_get_scheme (volume_device), "mbr") == 0)
|
|
Tomas Bzatek |
920f2d4 |
+ {
|
|
Tomas Bzatek |
920f2d4 |
+ gint type;
|
|
Tomas Bzatek |
920f2d4 |
+
|
|
Tomas Bzatek |
920f2d4 |
+ type = strtol (gdu_device_partition_get_type (volume_device), NULL, 0);
|
|
Tomas Bzatek |
920f2d4 |
+ if (type == 0x05 || type == 0x0f || type == 0x85)
|
|
Tomas Bzatek |
920f2d4 |
+ {
|
|
Tomas Bzatek |
920f2d4 |
+ GList *enclosed_logical;
|
|
Tomas Bzatek |
920f2d4 |
+ GList *ll;
|
|
Tomas Bzatek |
920f2d4 |
+
|
|
Tomas Bzatek |
920f2d4 |
+ enclosed_logical = gdu_pool_get_enclosed_presentables (pool, GDU_PRESENTABLE (volume));
|
|
Tomas Bzatek |
920f2d4 |
+ for (ll = enclosed_logical; ll != NULL && all_volumes_are_ignored; ll = ll->next)
|
|
Tomas Bzatek |
920f2d4 |
+ {
|
|
Tomas Bzatek |
920f2d4 |
+ GduPresentable *enclosed_logical_presentable = GDU_PRESENTABLE (ll->data);
|
|
Tomas Bzatek |
920f2d4 |
+
|
|
Tomas Bzatek |
920f2d4 |
+ if (GDU_IS_VOLUME (enclosed_logical_presentable))
|
|
Tomas Bzatek |
920f2d4 |
+ {
|
|
Tomas Bzatek |
920f2d4 |
+ if (!should_volume_be_ignored (pool,
|
|
Tomas Bzatek |
920f2d4 |
+ GDU_VOLUME (enclosed_logical_presentable),
|
|
Tomas Bzatek |
920f2d4 |
+ fstab_mount_points))
|
|
Tomas Bzatek |
920f2d4 |
+ {
|
|
Tomas Bzatek |
920f2d4 |
+ all_volumes_are_ignored = FALSE;
|
|
Tomas Bzatek |
920f2d4 |
+ }
|
|
Tomas Bzatek |
920f2d4 |
+ }
|
|
Tomas Bzatek |
920f2d4 |
+ }
|
|
Tomas Bzatek |
920f2d4 |
+ g_list_foreach (enclosed_logical, (GFunc) g_object_unref, NULL);
|
|
Tomas Bzatek |
920f2d4 |
+ g_list_free (enclosed_logical);
|
|
Tomas Bzatek |
920f2d4 |
+ }
|
|
Tomas Bzatek |
920f2d4 |
+ }
|
|
Tomas Bzatek |
920f2d4 |
+ g_object_unref (volume_device);
|
|
Tomas Bzatek |
920f2d4 |
+ }
|
|
Tomas Bzatek |
920f2d4 |
}
|
|
Tomas Bzatek |
920f2d4 |
}
|
|
Tomas Bzatek |
920f2d4 |
|
|
Tomas Bzatek |
920f2d4 |
--
|
|
Tomas Bzatek |
920f2d4 |
1.6.4.4
|
|
Tomas Bzatek |
920f2d4 |
|
|
Tomas Bzatek |
920f2d4 |
|