hal/hald/linux/volume_id volume_id.c, 1.24, 1.25 volume_id.h, 1.12, 1.13

Kay Sievers kay at freedesktop.org
Sun Aug 22 17:29:30 PDT 2004


Update of /cvs/hal/hal/hald/linux/volume_id
In directory gabe:/tmp/cvs-serv26358/hald/linux/volume_id

Modified Files:
	volume_id.c volume_id.h 
Log Message:
2004-08-23  Kay Sievers  <kay.sievers at vrfy.org>

        * hald/linux/volume_id/volume_id.c:
        (probe_msdos_part_table),
        (volume_id_probe): Patch from Sjoerd Simons <sjoerd at luon.net>
        to move msdos partition table probing to the end of the list.
        He found a ext3 with msdos signature on the first block.
        Also add a check if all partitions are empty, so  we do not
        recognize it as a msdos partition table.



Index: volume_id.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/volume_id/volume_id.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- volume_id.c	20 Aug 2004 14:41:47 -0000	1.24
+++ volume_id.c	23 Aug 2004 00:29:28 -0000	1.25
@@ -273,6 +273,7 @@
 
 	const __u8 *buf;
 	int i;
+	int empty = 1;
 
 	buf = get_buffer(id, off, 0x200);
 	if (buf == NULL)
@@ -287,7 +288,12 @@
 		if (part[i].boot_ind != 0 &&
 		    part[i].boot_ind != 0x80)
 			return -1;
+
+		if (le32_to_cpu(part[i].nr_sects) != 0)
+			empty = 0;
 	}
+	if (empty == 1)
+		return -1;
 
 	if (id->partitions != NULL)
 		free(id->partitions);
@@ -1719,9 +1725,6 @@
 		rc = probe_vfat(id, off);
 		if (rc == 0)
 			break;
-		rc = probe_msdos_part_table(id, off);
-		if (rc == 0)
-			break;
 
 		/* fill buffer with maximum */
 		get_buffer(id, 0, SB_BUFFER_SIZE);
@@ -1759,6 +1762,9 @@
 		rc = probe_ufs(id, off);
 		if (rc == 0)
 			break;
+		rc = probe_msdos_part_table(id, off);
+		if (rc == 0)
+			break;
 		rc = -1;
 	}
 

Index: volume_id.h
===================================================================
RCS file: /cvs/hal/hal/hald/linux/volume_id/volume_id.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- volume_id.h	20 Aug 2004 14:41:47 -0000	1.12
+++ volume_id.h	23 Aug 2004 00:29:28 -0000	1.13
@@ -21,7 +21,7 @@
 #ifndef _VOLUME_ID_H_
 #define _VOLUME_ID_H_
 
-#define VOLUME_ID_VERSION		014
+#define VOLUME_ID_VERSION		015
 
 #define VOLUME_ID_LABEL_SIZE		64
 #define VOLUME_ID_UUID_SIZE		16




More information about the hal-commit mailing list