New isw data offset?
Luke Yelavich <[email protected]> Tue, 5 May 2009 22:45:48 +1000
| Newsgroups | gmane.linux.ataraid |
|---|---|
| Message-ID | <[email protected]> |
I have recently received a bug report about a possible new ISW offset for disk metadata. The reporter attached a patch that he is using to use dmraid temporarily. Yes its hard coded, but it works for him atm, and it has the location of the metadata in it. He is using a pair of 1TB drives in RAID level 1. The offset is in exactly the same location on both drives, so I am not 100% sure its a host protected area issue, but this hasn't been confirmed either way yet. Attached is the patch, and the metadata dump. Luke _______________________________________________ Ataraid-list mailing list [email protected] https://www.redhat.com/mailman/listinfo/ataraid-list
dmraid-new-isw-offset.patch
(text/x-diff, 1.5 KB)
Index: dmraid/1.0.0.rc15/lib/format/ataraid/isw.c
===================================================================
--- dmraid.orig/1.0.0.rc15/lib/format/ataraid/isw.c 2009-05-05 12:13:24.197979374 +0000
+++ dmraid/1.0.0.rc15/lib/format/ataraid/isw.c 2009-05-05 12:13:24.209979407 +0000
@@ -503,13 +503,16 @@
}
static void *
-isw_read_metadata(struct lib_context *lc, struct dev_info *di,
- size_t * sz, uint64_t * offset, union read_info *info)
+isw_try_sboffset(struct lib_context *lc, struct dev_info *di,
+ size_t * sz, uint64_t * offset, union read_info *info,
+ uint64_t const isw_sboffset)
{
+
size_t size = ISW_DISK_BLOCK_SIZE;
- uint64_t isw_sboffset = ISW_CONFIGOFFSET(di);
struct isw *isw;
+ printf("isw metadata found at %ld\n", isw_sboffset);
+
if (!(isw = alloc_private_and_read(lc, handler, size,
di->path, isw_sboffset)))
goto out;
@@ -545,6 +548,21 @@
return (void *) isw;
}
+static void *
+isw_read_metadata(struct lib_context *lc, struct dev_info *di,
+ size_t * sz, uint64_t * offset, union read_info *info)
+{
+ uint64_t isw_sboffset = ISW_CONFIGOFFSET(di);
+ void *result;
+ if ((result = isw_try_sboffset(
+ lc, di, sz, offset, info, ISW_CONFIGOFFSET(di))))
+ return result;
+ if ((result = isw_try_sboffset(
+ lc, di, sz, offset, info, 1000203803136L)))
+ return result;
+ return NULL;
+}
+
static int setup_rd(struct lib_context *lc, struct raid_dev *rd,
struct dev_info *di, void *meta, union read_info *info);
static struct raid_dev *
dmraid.isw.tar.bz2
(application/octet-stream, 460 B) - not displayed
signature.asc
(application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkoANPwACgkQjVefwtBjIM58YACgohvOJYMLMqo5GgcTsrJNaUDN oTYAoI6qenjwmidfp+cS509Pi9Yd0VP+ =KHyt -----END PGP SIGNATURE-----