From patchwork Wed Aug 24 14:28:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: heinzm@sourceware.org X-Patchwork-Id: 1092812 Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7OEVbZb012220 for ; Wed, 24 Aug 2011 14:31:57 GMT Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p7OET1UT028711; Wed, 24 Aug 2011 10:29:02 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p7OET0VA012758 for ; Wed, 24 Aug 2011 10:29:00 -0400 Received: from mx1.redhat.com (ext-mx13.extmail.prod.ext.phx2.redhat.com [10.5.110.18]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p7OESsfQ006098 for ; Wed, 24 Aug 2011 10:28:55 -0400 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by mx1.redhat.com (8.14.4/8.14.4) with SMTP id p7OESmUp025935 for ; Wed, 24 Aug 2011 10:28:48 -0400 Received: (qmail 15576 invoked by uid 9450); 24 Aug 2011 14:28:47 -0000 Date: 24 Aug 2011 14:28:47 -0000 Message-ID: <20110824142847.15574.qmail@sourceware.org> From: heinzm@sourceware.org To: dm-cvs@sourceware.org, dm-devel@redhat.com X-RedHat-Spam-Score: -2.832 (RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.18 X-loop: dm-devel@redhat.com Subject: [dm-devel] dmraid/lib/format/ddf ddf1.c ddf1_dump.c X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 24 Aug 2011 14:31:57 +0000 (UTC) CVSROOT: /cvs/dm Module name: dmraid Changes by: heinzm@sourceware.org 2011-08-24 14:28:47 Modified files: lib/format/ddf : ddf1.c ddf1_dump.c Log message: 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- Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ddf/ddf1.c.diff?cvsroot=dm&r1=1.8&r2=1.9 http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ddf/ddf1_dump.c.diff?cvsroot=dm&r1=1.3&r2=1.4 --- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel --- dmraid/lib/format/ddf/ddf1.c 2010/03/18 16:53:17 1.8 +++ dmraid/lib/format/ddf/ddf1.c 2011/08/24 14:28:46 1.9 @@ -526,7 +526,8 @@ ddf1_sboffset) || !is_ddf1(lc, di, ddf1)) goto bad; - ddf1->anchor_offset = ddf1_sboffset; + /* ddf1_sboffset is in bytes. */ + ddf1->anchor_offset = ddf1_sboffset >> 9; /* Convert endianness */ ddf1->in_cpu_format = 0; @@ -962,6 +963,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; --- dmraid/lib/format/ddf/ddf1_dump.c 2010/07/13 20:22:38 1.3 +++ dmraid/lib/format/ddf/ddf1_dump.c 2011/08/24 14:28:46 1.4 @@ -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")); }