[PATCH] DVH: do not inform kernel/DM about directory entries

Petr Uzel petr.uzel at suse.cz
Thu Nov 6 15:26:59 UTC 2008


---
 libparted/arch/linux.c |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index 0107dd2..041208a 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -2248,7 +2248,15 @@ static int
 _disk_sync_part_table (PedDisk* disk)
 {
         int     i;
-        int     last =3D PED_MAX (ped_disk_get_last_partition_num (disk)=
, 16);
+        int     last;
+
+	/* parted treats DVH directory entries as logical partitions with numbe=
r > 16;
+	 * we don't want to inform kernel about directory entries
+	 */
+	if (strcmp (disk->type->name, "dvh") =3D=3D 0)
+		last =3D 16;
+	else
+	 	last =3D PED_MAX (ped_disk_get_last_partition_num (disk), 16);
         int*    rets =3D ped_malloc(sizeof(int) * last);
         int*    errnums =3D ped_malloc(sizeof(int) * last);
         int     ret =3D 1;
@@ -2470,8 +2478,16 @@ static int
 _dm_reread_part_table (PedDisk* disk)
 {
         int     rc =3D 1;
-        int     last =3D PED_MAX (ped_disk_get_last_partition_num (disk)=
, 16);
         int     i;
+        int     last;
+
+	/* parted treats DVH directory entries as partitions logical with numbe=
r > 16;
+	 * we don't want to inform kernel about directory entries
+	 */
+	if (strcmp (disk->type->name, "dvh") =3D=3D 0)
+		last =3D 16;
+	else
+	 	last =3D PED_MAX (ped_disk_get_last_partition_num (disk), 16);
=20
         sync();
         if (!_dm_remove_parts(disk->dev))
--=20
1.6.0.2


--=20
Best regards / s pozdravem

Petr Uzel, Packages maintainer
---------------------------------------------------------------------
SUSE LINUX, s.r.o.                          e-mail: puzel at suse.cz
Lihovarsk=E1 1060/12                          tel: +420 284 028 964
190 00 Prague 9                             fax: +420 284 028 951
Czech Republic                              http://www.suse.cz



More information about the parted-devel mailing list