All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: update volume_id
Date: Tue, 05 Oct 2004 22:41:17 +0000	[thread overview]
Message-ID: <20041005224117.GA7913@vrfy.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 128 bytes --]

You're catching up too fast :). Here is an update to the latest
volume_id which fixes a few bugs with FAT volumes.

Thanks,
Kay

[-- Attachment #2: udev-vid-25-01.patch --]
[-- Type: text/plain, Size: 3336 bytes --]

diff -Nru a/extras/volume_id/volume_id.c b/extras/volume_id/volume_id.c
--- a/extras/volume_id/volume_id.c	2004-10-06 00:36:16 +02:00
+++ b/extras/volume_id/volume_id.c	2004-10-06 00:36:16 +02:00
@@ -321,7 +321,7 @@
 found:
 	strncpy(id->type_version, lvm->type, 8);
 	id->usage_id = VOLUME_ID_RAID;
-	id->type_id = VOLUME_ID_LVM1;
+	id->type_id = VOLUME_ID_LVM2;
 	id->type = "LVM2_member";
 
 	return 0;
@@ -461,6 +461,8 @@
 
 		p = &id->partitions[i];
 
+		p->partition_type_raw = part[i].sys_ind;
+
 		if (is_extended(part[i].sys_ind)) {
 			dbg("found extended partition at 0x%llx", poff);
 			p->usage_id = VOLUME_ID_PARTITIONTABLE;
@@ -535,6 +537,9 @@
 				p->off = current + poff;
 				p->len = plen;
 				id->partition_count++;
+
+				p->partition_type_raw = part[i].sys_ind;
+
 				if (id->partition_count >= VOLUME_ID_PARTITIONS_MAX) {
 					dbg("to many partitions");
 					next = 0;
@@ -918,13 +923,13 @@
 
 	for (i = 0; i <= root_dir_entries; i++) {
 		/* end marker */
-		if (dir[i].attr == 0x00) {
+		if (dir[i].name[0] == 0x00) {
 			dbg("end of dir");
 			break;
 		}
 
 		/* empty entry */
-		if (dir[i].attr == 0xe5)
+		if (dir[i].name[0] == 0xe5)
 			continue;
 
 		if (dir[i].attr == FAT_ATTR_VOLUME) {
@@ -976,13 +981,13 @@
 
 		for (i = 0; i <= count; i++) {
 			/* end marker */
-			if (dir[i].attr == 0x00) {
+			if (dir[i].name[0] == 0x00) {
 				dbg("end of dir");
 				goto fat32_label;
 			}
 
 			/* empty entry */
-			if (dir[i].attr == 0xe5)
+			if (dir[i].name[0] == 0xe5)
 				continue;
 
 			if (dir[i].attr == FAT_ATTR_VOLUME) {
@@ -1016,7 +1021,7 @@
 		set_label_raw(id, vs->type.fat32.label, 11);
 		set_label_string(id, vs->type.fat32.label, 11);
 	}
-	set_uuid(id, vs->type.fat32.serno, UUID_DCE);
+	set_uuid(id, vs->type.fat32.serno, UUID_DOS);
 
 found:
 	id->usage_id = VOLUME_ID_FILESYSTEM;
@@ -2035,20 +2040,27 @@
 		break;
 	case VOLUME_ID_ALL:
 	default:
+		/* probe for raid first, cause fs probes may be successful on raid members */
 		rc = probe_linux_raid(id, off, size);
 		if (rc == 0)
 			break;
-
-		/* signature in the first block */
-		rc = probe_ntfs(id, off);
+		rc = probe_lvm1(id, off);
 		if (rc == 0)
 			break;
-		rc = probe_vfat(id, off);
+		rc = probe_lvm2(id, off);
 		if (rc == 0)
 			break;
+
+		/* signature in the first block, only small buffer needed */
 		rc = probe_msdos_part_table(id, off);
 		if (rc == 0)
 			break;
+		rc = probe_ntfs(id, off);
+		if (rc == 0)
+			break;
+		rc = probe_vfat(id, off);
+		if (rc == 0)
+			break;
 		rc = probe_mac_partition_map(id, off);
 		if (rc == 0)
 			break;
@@ -2081,12 +2093,6 @@
 		if (rc == 0)
 			break;
 		rc = probe_ufs(id, off);
-		if (rc == 0)
-			break;
-		rc = probe_lvm1(id, off);
-		if (rc == 0)
-			break;
-		rc = probe_lvm2(id, off);
 		if (rc == 0)
 			break;
 
diff -Nru a/extras/volume_id/volume_id.h b/extras/volume_id/volume_id.h
--- a/extras/volume_id/volume_id.h	2004-10-06 00:36:16 +02:00
+++ b/extras/volume_id/volume_id.h	2004-10-06 00:36:16 +02:00
@@ -21,7 +21,7 @@
 #ifndef _VOLUME_ID_H_
 #define _VOLUME_ID_H_
 
-#define VOLUME_ID_VERSION		024
+#define VOLUME_ID_VERSION		25
 
 #define VOLUME_ID_LABEL_SIZE		64
 #define VOLUME_ID_UUID_SIZE		16
@@ -68,6 +68,7 @@
 	char		*type;
 	unsigned long long off;
 	unsigned long long len;
+	unsigned int partition_type_raw;
 };
 
 struct volume_id {

             reply	other threads:[~2004-10-05 22:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-05 22:41 Kay Sievers [this message]
2004-10-05 23:58 ` update volume_id Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041005224117.GA7913@vrfy.org \
    --to=kay.sievers@vrfy.org \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.