FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 08-23-2011, 08:02 AM
NeilBrown
 
Default dmraid: allow "dmraid --erase_metadata" to work with ddf

Hi,
current dmraid cannot erase ddf metadata.
It tries to seek to an offset too big by a factor of 512, and then writes
zero bytes to the anchor.

"ddf1->anchor_offset" is set to a number of bytes and sometimes treated as
bytes - sometimes as sectors.
This patch makes it always sectors and also sets the size of the anchor
metadata area to DDF1_BLKSIZE

Signed-off-by: NeilBrown <neilb@suse.de>


Index: lib/format/ddf/ddf1.c
================================================== =================
RCS file: /cvs/dm/dmraid/lib/format/ddf/ddf1.c,v
retrieving revision 1.8
diff -u -r1.8 ddf1.c
--- lib/format/ddf/ddf1.c 18 Mar 2010 16:53:17 -0000 1.8
+++ lib/format/ddf/ddf1.c 23 Aug 2011 08:01:13 -0000
@@ -526,7 +526,7 @@
ddf1_sboffset) || !is_ddf1(lc, di, ddf1))
goto bad;

- ddf1->anchor_offset = ddf1_sboffset;
+ ddf1->anchor_offset = ddf1_sboffset / 512;

/* Convert endianness */
ddf1->in_cpu_format = 0;
@@ -962,6 +962,7 @@
ma[i].offset = ddf1->primary->primary_table_lba;

ma->offset = ddf1->anchor_offset;
+ ma->size = DDF1_BLKSIZE;
(ma++)->area = &ddf1->anchor;

(ma++)->area = ddf1->primary;
Index: lib/format/ddf/ddf1_dump.c
================================================== =================
RCS file: /cvs/dm/dmraid/lib/format/ddf/ddf1_dump.c,v
retrieving revision 1.3
diff -u -r1.3 ddf1_dump.c
--- lib/format/ddf/ddf1_dump.c 13 Jul 2010 20:22:38 -0000 1.3
+++ lib/format/ddf/ddf1_dump.c 23 Aug 2011 08:01:13 -0000
@@ -60,7 +60,7 @@
{
log_print(lc, "%s (%s):", di->path, handler);
log_print(lc, "DDF1 anchor at %llu with tables in %s-endian format.",
- ddf1->anchor_offset / DDF1_BLKSIZE,
+ ddf1->anchor_offset,
(ddf1->disk_format == LITTLE_ENDIAN ? "little" : "big"));
}


--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 10:11 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org