Skip to contentSkip to conversation

vol_id and RAID 1.0 metadata

PATCH Scott James Remnant 2 participants 2 messages Aug 28, 2007 – Aug 29, 2007

lore
Share & tools
lore
#0 lore raw

We've had a bug report filed for Ubuntu caused by vol_id not correctly detecting a RAID1 with 1.0 metadata:

	https://bugs.launchpad.net/ubuntu/+source/udev/+bug/133773

A patch is attached to the bug (attached again here), does this seem a reasonable fix?

Scott

Signature · 3 lines
Scott James Remnant
Ubuntu Development Manager
[email protected]
extras/volume_id/lib/linux_raid.c +10 -3
diff -urp udev-113/extras/volume_id/lib/linux_raid.c udev-113.mod/extras/volume_id/lib/linux_raid.c
@@ -142,14 +142,21 @@ static int volume_id_probe_linux_raid1(s
 
 int volume_id_probe_linux_raid(struct volume_id *id, uint64_t off, uint64_t size)
 {
-	uint64_t sboff = (size & ~(MD_RESERVED_BYTES - 1)) - MD_RESERVED_BYTES;
+	uint64_t sboff1 =
+            (size & ~(MD_RESERVED_BYTES - 1)) - MD_RESERVED_BYTES;
+        uint64_t sboff2 =
+            size < 0x3000 ? 0x0400 : (size - 0x2000 & ~0x0e00);
 
 	/* version 0 at the end of the device */
-	if (volume_id_probe_linux_raid0(id, off + sboff, size) == 0)
+	if (volume_id_probe_linux_raid0(id, off + sboff1, size) == 0)
+		return 0;
+	if (volume_id_probe_linux_raid0(id, off + sboff2, size) == 0)
 		return 0;
 
 	/* version 1.0 at the end of the device */
-	if (volume_id_probe_linux_raid1(id, off + sboff, size) == 0)
+	if (volume_id_probe_linux_raid1(id, off + sboff1, size) == 0)
+		return 0;
+	if (volume_id_probe_linux_raid1(id, off + sboff2, size) == 0)
 		return 0;
 
 	/* version 1.1 at the start of the device */

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/

_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw
Quoted 4 lines · Scott James Remnant

We've had a bug report filed for Ubuntu caused by vol_id not correctly detecting a RAID1 with 1.0 metadata:

        https://bugs.launchpad.net/ubuntu/+source/udev/+bug/133773

Seems like a bug for metadata 1.0, yes.

Quoted 2 lines

A patch is attached to the bug (attached again here), does this seem a reasonable fix?

But the UUID looks strange:
ID_FS_UUIDœ0818c2:00000000:00000000:00000000

I see the same thing here with this patch:

  $ mdadm -E /dev/sda7
  Array UUID : 847bf627:97a28f2a:37e21246:25b446b1
  $ extras/volume_id/vol_id /dev/sda7
  ID_FS_UUID*8fa297:00000000:00000000:00000000

With a different one line fix to the lib it seems fine:

  $ extras/volume_id/vol_id /dev/sda7
  ID_FS_UUID_ENC„7bf627:97a28f2a:37e21246:25b446b1

I've committed it to the udev tree. Thanks for letting us know, Kay

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel