linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* vol_id and RAID 1.0 metadata
@ 2007-08-28 16:44 Scott James Remnant
  2007-08-29  4:03 ` Kay Sievers
  0 siblings, 1 reply; 2+ messages in thread
From: Scott James Remnant @ 2007-08-28 16:44 UTC (permalink / raw)
  To: linux-hotplug


[-- Attachment #1.1.1: Type: text/plain, Size: 345 bytes --]

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
-- 
Scott James Remnant
Ubuntu Development Manager
scott@ubuntu.com

[-- Attachment #1.1.2: udev-volid-md1.patch --]
[-- Type: text/x-patch, Size: 1278 bytes --]

diff -urp udev-113/extras/volume_id/lib/linux_raid.c udev-113.mod/extras/volume_id/lib/linux_raid.c
--- udev-113/extras/volume_id/lib/linux_raid.c	2007-06-24 01:44:48.000000000 +1000
+++ udev-113.mod/extras/volume_id/lib/linux_raid.c	2007-08-28 22:11:47.000000000 +1000
@@ -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 */

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 315 bytes --]

-------------------------------------------------------------------------
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/

[-- Attachment #3: Type: text/plain, Size: 226 bytes --]

_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: vol_id and RAID 1.0 metadata
  2007-08-28 16:44 vol_id and RAID 1.0 metadata Scott James Remnant
@ 2007-08-29  4:03 ` Kay Sievers
  0 siblings, 0 replies; 2+ messages in thread
From: Kay Sievers @ 2007-08-29  4:03 UTC (permalink / raw)
  To: linux-hotplug

On 8/28/07, Scott James Remnant <scott@ubuntu.com> wrote:
> 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.

> 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
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-08-29  4:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-28 16:44 vol_id and RAID 1.0 metadata Scott James Remnant
2007-08-29  4:03 ` Kay Sievers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).