Ubuntu

Merge lp:~psusi/ubuntu/natty/dmraid/fixes into lp:ubuntu/natty/dmraid

Proposed by Phillip Susi on 2011-03-05
Status: Merged
Merged at revision: 57
Proposed branch: lp:~psusi/ubuntu/natty/dmraid/fixes
Merge into: lp:ubuntu/natty/dmraid
Diff against target: 415 lines (+364/-0) 8 files modified
To merge this branch: bzr merge lp:~psusi/ubuntu/natty/dmraid/fixes
Reviewer Review Type Date Requested Status
Colin Watson 2011-03-05 Approve on 2011-03-25
Phillip Susi (community) Resubmit on 2011-03-24
Review via email: mp+52284@code.launchpad.net

Description of the Change

  * Added 21_fix_testing.patch: Testing with dm devices was failing
    on Ubuntu because /dev/dm-X is the actual device node, but the
    code wanted it to be a symlink. Fixed dm_test_device() to test
    that the file ( or node it points to ) is a block device, which
    seems a much more appropriate test.
  * Added 22_add_pdc_64bit_addressing.patch: PDC metadata locations for
    high bytes of raid set sector count (LP: #599255)
    [ Danny Wood <email address hidden> ]
  * Added 23_pdc_dump_extended_metadata.patch: PDC supports up to 4
    sets of metadata to describe different arrays. Only the first
    set was being dumped with dmraid -rD or -n. Also fixes the
    .offset file, which was always 0 instead of the actual offset.
  * Added 04_drop_p_for_partition_conditional.patch:
    dmraid was changed at one point to insert a 'p' between
    the base device name and the partition number. For
    some time debian and ubuntu reversed this change. This
    patch modifies the behavior to add the 'p' iff the last
    character of the base name is a digit. This makes
    dmraid comply with the behavior used by kpartx and
    "by linux since the dawn of time".
  * Fix once again the jmicron naming bug, upstream fix does not work
    (LP: #576289)
    [ Danny Wood <email address hidden> ]

To post a comment you must log in.
Barry Warsaw (barry) wrote :

Do you need to mention in the changelog that you're removing a bogus .orig file too with this patch?

Phillip Susi (psusi) wrote :

Oops, I didn't actually mean to commit that removal, but it doesn't hurt anything. That and also a src/dmraid.static binary seem to be garbage files that made it into the .orig.tar.gz by mistake. Do you think the changelog needs to bother mentioning it, or would it be better to fix up the commit to not bother removing it?

Bryce Harrington (bryce) wrote :

If it were me, I'd mention it in the changelog but I don't think it's that important.

One thing that would help me as a sponsor (given my complete dearth of knowledge of dmraid internals and the quantity of patches in this changeset) would be a discussion of testing activities that have been done with these patches or this changeset as a whole. How many people have tested the patches and in what ways?

Phillip Susi (psusi) wrote :

I tested by installing it on the natty daily livecd and making sure that parted, gparted, and ubiquity were able to add and remove partitions and that they showed up with the correct names. Also Danny Wood tested it and reported that it worked correctly with his jmicron controller that does end in a digit, so it correctly added the 'p' before the partition number.

Also I might mention that this goes hand in hand with my merge request for parted. In fact, now that I think about it, I should probably set the dependency field to require that as well, or maybe Breaks: previous versions?

Colin Watson (cjwatson) wrote :

On Tue, Mar 08, 2011 at 03:28:57AM -0000, Phillip Susi wrote:
> Also I might mention that this goes hand in hand with my merge request
> for parted. In fact, now that I think about it, I should probably set
> the dependency field to require that as well, or maybe Breaks:
> previous versions?

I think I would be inclined to recommend mutual Breaks: ... (<< ...)
between libdmraid1.0.0.rc16 and libparted0debian1.

Colin Watson (cjwatson) wrote :
Download full text (3.3 KiB)

> === removed file '1.0.0.rc16/lib/activate/activate.c.orig'

There's no point in removing this; it's in the upstream tarball, so it
will just be recreated on unpack anyway. 'debuild clean' or similar may
have removed it.

Don't worry too much about this, though; I'll just revert this part of
your branch when merging.

> === added file 'debian/patches/04_drop_p_for_partition_conditional.patch'
> --- debian/patches/04_drop_p_for_partition_conditional.patch 1970-01-01 00:00:00 +0000
> +++ debian/patches/04_drop_p_for_partition_conditional.patch 2011-03-05 05:41:54 +0000
> @@ -0,0 +1,31 @@
> +dmraid was changed at one point to insert a 'p' between
> +the base device name and the partition number. For
> +some time debian and ubuntu reversed this change. This
> +patch modifies the behavior to add the 'p' iff the last
> +character of the base name is a digit. This makes
> +dmraid comply with the behavior used by kpartx and
> +"by linux since the dawn of time".
> +
> +Phillip Susi <email address hidden>

Please use DEP-3 headers in your patches. Unlike informal annotations
such as this, they can be parsed by scripts. In particular, please
include bug annotations so that we have an audit trail for patches that
doesn't involve digging back through changelogs, and please make sure
all patches have proper attribution. The DEP-3 format also includes
fields for tracking whether and where patches have been forwarded
upstream.

Here's the format:

  http://dep.debian.net/deps/dep3/

> +Index: dmraid/1.0.0.rc16/lib/format/partition/dos.c
> +===================================================================
> +--- dmraid.orig/1.0.0.rc16/lib/format/partition/dos.c 2011-03-04 19:26:26.161474366 -0500
> ++++ dmraid/1.0.0.rc16/lib/format/partition/dos.c 2011-03-04 19:27:06.961474362 -0500
> +@@ -31,8 +31,14 @@
> + {
> + const char *base = get_basename(lc, rd->di->path);
> +
> +- return type ? snprintf(str, len, "%s%s%u", base, OPT_STR_PARTCHAR(lc),
> +- partition) : snprintf(str, len, "%s", base);
> ++ if (type)
> ++ {
> ++ if (isdigit(base[strlen(base)-1]))
> ++ return snprintf(str, len, "%s%s%u", base,
> ++ OPT_STR_PARTCHAR(lc), partition);

Please use consistent indentation (which is far more important than any
one style - the hardest style to read is a mixed style). To be
consistent with the function it's in, this return should be indented by
a full tab from the if.

> === modified file 'debian/patches/series'
> --- debian/patches/series 2010-11-07 17:34:24 +0000
> +++ debian/patches/series 2011-03-05 05:41:54 +0000
> @@ -9,3 +9,7 @@
> 18_pdc_raid10_failure..patch
> 19_ddf1_lsi_persistent_name.patch
> 20_fix_isw_sectors_calculation.patch
> +21_fix_testing.patch
> +22_add_pdc_64bit_addressing.patch
> +23_pdc_dump_extended_metadata.patch
> +04_drop_p_for_partition_conditional.patch

Please ensure that the patch sequence numbers match the order in which
patches are actually applied; it's horribly confusing otherwise. I
don't mind whether you do this by renaming
04_drop_p_for_partition_conditional.patch or by inserting it somewhere
else in the order, although it's generally conventional for Ubuntu
patches to be applied after Debia...

Read more...

review: Needs Fixing
lp:~psusi/ubuntu/natty/dmraid/fixes updated on 2011-03-08
57. By Phillip Susi on 2011-03-08

Added 21_fix_testing.patch: Testing with dm devices was failing
on Ubuntu because /dev/dm-X is the actual device node, but the
code wanted it to be a symlink. Fixed dm_test_device() to test
that the file ( or node it points to ) is a block device, which
seems a much more appropriate test.

Phillip Susi (psusi) wrote :

How about dem apples?

review: Resubmit
Phillip Susi (psusi) wrote :

Hold off on this a bit; while working on fixing another bug with a pdc raid10 I found that the pdc 64 bit patch seems to have a problem. It looks like the high word is actually only a byte. Will resubmit that patch tomorrow.

review: Needs Fixing
lp:~psusi/ubuntu/natty/dmraid/fixes updated on 2011-03-24
58. By Phillip Susi on 2011-03-24

Added 22_add_pdc_64bit_addressing.patch: PDC metadata locations for
high bytes of raid set sector count (LP: #599255)
[ Danny Wood <email address hidden> ]

59. By Phillip Susi on 2011-03-24

Added 23_pdc_dump_extended_metadata.patch: PDC supports up to 4
sets of metadata to describe different arrays. Only the first
set was being dumped with dmraid -rD or -n. Also fixes the
.offset file, which was always 0 instead of the actual offset.

60. By Phillip Susi on 2011-03-24

Added 24_drop_p_for_partition_conditional.patch:
dmraid was changed at one point to insert a 'p' between
the base device name and the partition number. For
some time debian and ubuntu reversed this change. This
patch modifies the behavior to add the 'p' iff the last
character of the base name is a digit. This makes
dmraid comply with the behavior used by kpartx and
"by linux since the dawn of time".

61. By Phillip Susi on 2011-03-24

Fix once again the jmicron naming bug, upstream fix does not work
(LP: #576289)
[ Danny Wood <email address hidden> ]

62. By Phillip Susi on 2011-03-24

Breaks libparted0debian1 (<< 2.3-5ubuntu4)

Phillip Susi (psusi) wrote :

Updated, should be good to go.

review: Resubmit
Colin Watson (cjwatson) wrote :

Thanks, this looks much better now.

review: Approve

Preview Diff

1=== modified file 'debian/changelog'
2--- debian/changelog 2011-01-26 16:30:29 +0000
3+++ debian/changelog 2011-03-24 00:42:46 +0000
4@@ -1,3 +1,32 @@
5+dmraid (1.0.0.rc16-4.1ubuntu2) natty; urgency=low
6+
7+ * Added 21_fix_testing.patch: Testing with dm devices was failing
8+ on Ubuntu because /dev/dm-X is the actual device node, but the
9+ code wanted it to be a symlink. Fixed dm_test_device() to test
10+ that the file ( or node it points to ) is a block device, which
11+ seems a much more appropriate test.
12+ * Added 22_add_pdc_64bit_addressing.patch: PDC metadata locations for
13+ high bytes of raid set sector count (LP: #599255)
14+ [ Danny Wood <danwood76@gmail.com> ]
15+ * Added 23_pdc_dump_extended_metadata.patch: PDC supports up to 4
16+ sets of metadata to describe different arrays. Only the first
17+ set was being dumped with dmraid -rD or -n. Also fixes the
18+ .offset file, which was always 0 instead of the actual offset.
19+ * Added 24_drop_p_for_partition_conditional.patch:
20+ dmraid was changed at one point to insert a 'p' between
21+ the base device name and the partition number. For
22+ some time debian and ubuntu reversed this change. This
23+ patch modifies the behavior to add the 'p' iff the last
24+ character of the base name is a digit. This makes
25+ dmraid comply with the behavior used by kpartx and
26+ "by linux since the dawn of time".
27+ * Fix once again the jmicron naming bug, upstream fix does not work
28+ (LP: #576289)
29+ [ Danny Wood <danwood76@gmail.com> ]
30+ * Breaks libparted0debian1 (<< 2.3-5ubuntu4)
31+
32+ -- Phillip Susi <psusi@cfl.rr.com> Fri, 04 Mar 2011 13:42:01 -0500
33+
34 dmraid (1.0.0.rc16-4.1ubuntu1) natty; urgency=low
35
36 * Merge from debian unstable. Remaining changes: (LP: #707776)
37
38=== modified file 'debian/control'
39--- debian/control 2010-02-04 21:34:22 +0000
40+++ debian/control 2011-03-24 00:42:46 +0000
41@@ -48,6 +48,7 @@
42 Section: debian-installer
43 XC-Package-Type: udeb
44 Depends: ${shlibs:Depends}
45+Breaks: libparted0debian1 (<< 2.3-5ubuntu4)
46 Description: Device-Mapper Software RAID support tool - shared library (udeb)
47 dmraid discovers, activates, deactivates and displays properties
48 of software RAID sets (eg, ATARAID) and contained DOS partitions.
49
50=== added file 'debian/patches/21_fix_testing.patch'
51--- debian/patches/21_fix_testing.patch 1970-01-01 00:00:00 +0000
52+++ debian/patches/21_fix_testing.patch 2011-03-24 00:42:46 +0000
53@@ -0,0 +1,24 @@
54+From: Phillip Susi <psusi@cfl.rr.com>
55+Last-Update: 2011-03-08
56+Forwarded: yes
57+Description: Testing with dm devices was failing on Ubuntu because
58+ /dev/dm-X is the actual device node, but the code wanted it to be
59+ a symlink. Fixed dm_test_device() to test that the file ( or node
60+ it points to ) is a block device, which seems a much more
61+ appropriate test.
62+
63+Index: b/1.0.0.rc16/lib/device/scan.c
64+===================================================================
65+--- a/1.0.0.rc16/lib/device/scan.c
66++++ b/1.0.0.rc16/lib/device/scan.c
67+@@ -86,8 +86,8 @@
68+ {
69+ struct stat s;
70+
71+- return !lstat(path, &s) &&
72+- S_ISLNK(s.st_mode) &&
73++ return !stat(path, &s) &&
74++ S_ISBLK(s.st_mode) &&
75+ !strncmp(get_basename(lc, path), "dm-", 3);
76+ }
77+
78
79=== added file 'debian/patches/21_jmicron_namefix.patch'
80--- debian/patches/21_jmicron_namefix.patch 1970-01-01 00:00:00 +0000
81+++ debian/patches/21_jmicron_namefix.patch 2011-03-24 00:42:46 +0000
82@@ -0,0 +1,20 @@
83+From: Phillip Susi <psusi@cfl.rr.com>
84+Author: Danny Wood <danwood76@gmail.com>
85+Subject: Fix jmicron names again
86+Bug-Ubuntu: http://launchpad.net/bugs/576289
87+Last-Update: 2011-03-08
88+Description: Uninitialized variable prevented code from working
89+ as intended.
90+Index: b/1.0.0.rc16/lib/format/ataraid/jm.c
91+===================================================================
92+--- a/1.0.0.rc16/lib/format/ataraid/jm.c
93++++ b/1.0.0.rc16/lib/format/ataraid/jm.c
94+@@ -25,7 +25,7 @@
95+ static char *
96+ name(struct lib_context *lc, struct raid_dev *rd, unsigned int subset)
97+ {
98+- size_t i, len;
99++ size_t i = JM_NAME_LEN - 1, len;
100+ struct jm *jm = META(rd, jm);
101+ char *ret, *name = (char *) jm->name;
102+ char buf[JM_NAME_LEN + 1] = { '\0' };
103
104=== added file 'debian/patches/22_add_pdc_64bit_addressing.patch'
105--- debian/patches/22_add_pdc_64bit_addressing.patch 1970-01-01 00:00:00 +0000
106+++ debian/patches/22_add_pdc_64bit_addressing.patch 2011-03-24 00:42:46 +0000
107@@ -0,0 +1,101 @@
108+From: Phillip Susi <psusi@cfl.rr.com>
109+Author: Danny Wood <danwood76@gmail.com>
110+Bug-Ubuntu: http://launchpad.net/bugs/599255
111+Subject: Adds 64-bit sector addressing to PDC driver
112+Last-Update: 2011-03-08
113+Forwarded: yes
114+
115+Index: b/1.0.0.rc16/lib/format/ataraid/pdc.c
116+===================================================================
117+--- a/1.0.0.rc16/lib/format/ataraid/pdc.c
118++++ b/1.0.0.rc16/lib/format/ataraid/pdc.c
119+@@ -132,7 +132,7 @@
120+ CVT32(pdc->raid.flags);
121+ CVT32(pdc->raid.magic_0);
122+ CVT32(pdc->raid.disk_secs);
123+- CVT32(pdc->raid.total_secs);
124++ CVT32(pdc->raid.total_secs_l);
125+ CVT16(pdc->raid.cylinders);
126+ CVT32(pdc->raid.magic_1);
127+
128+@@ -194,6 +194,9 @@
129+ if (read_file(lc, handler, di->path,
130+ ret + ma, sizeof(*ret),
131+ sector << 9)) {
132++ /* Log the metadata location */
133++ log_dbg(lc, "checking pdc metadata at %ld",sector << 9);
134++
135+ /* No signature? */
136+ if (!is_signature(ret + ma)) {
137+ if (info->u32)
138+@@ -311,13 +314,13 @@
139+
140+ switch (pdc->raid.type) {
141+ case PDC_T_RAID10:
142+- return pdc->raid.total_secs / (pdc->raid.total_disks / 2);
143++ return (((uint64_t)pdc->raid.total_secs_h << 32) + pdc->raid.total_secs_l) / (pdc->raid.total_disks / 2);
144+
145+ case PDC_T_RAID1:
146+- return pdc->raid.total_secs;
147++ return (((uint64_t)pdc->raid.total_secs_h << 32) + pdc->raid.total_secs_l);
148+
149+ case PDC_T_RAID0:
150+- return pdc->raid.total_secs / pdc->raid.total_disks;
151++ return (((uint64_t)pdc->raid.total_secs_h << 32) + pdc->raid.total_secs_l) / pdc->raid.total_disks;
152+
153+ case PDC_T_SPAN:
154+ return rd->di->sectors - meta_sector;
155+@@ -494,12 +497,12 @@
156+ pdc->raid.total_disks / 2 :
157+ pdc->raid.total_disks;
158+ }
159+-
160++
161+ static int
162+ check_rd(struct lib_context *lc, struct raid_set *rs,
163+ struct raid_dev *rd, void *context)
164+ {
165+- return *((uint64_t *) context) >= (META(rd, pdc))->raid.total_secs;
166++ return *((uint64_t *) context) >= (((uint64_t)(META(rd, pdc))->raid.total_secs_h << 32) + (META(rd, pdc))->raid.total_secs_l);
167+ }
168+
169+ static int
170+@@ -579,13 +582,16 @@
171+ DP("raid.raid0_shift: %u", pdc, pdc->raid.raid0_shift);
172+ DP("raid.raid0_disks: %u", pdc, pdc->raid.raid0_disks);
173+ DP("raid.array_number: %u", pdc, pdc->raid.array_number);
174+- DP("raid.total_secs: %u", pdc, pdc->raid.total_secs);
175++ DP("raid.total_secs_h: %u", pdc, pdc->raid.total_secs_h);
176++ DP("raid.total_secs_l: %u", pdc, pdc->raid.total_secs_l);
177+ DP("raid.cylinders: %u", pdc, pdc->raid.cylinders);
178+ DP("raid.heads: %u", pdc, pdc->raid.heads);
179+ DP("raid.sectors: %u", pdc, pdc->raid.sectors);
180+ DP("raid.magic_1: 0x%x", pdc, pdc->raid.magic_1);
181+ P("raid.unknown_5: 0x%x %u",
182+ pdc, pdc->raid.unknown_5, pdc->raid.unknown_5, pdc->raid.unknown_5);
183++ P("raid.unknown_6: 0x%x %u",
184++ pdc, pdc->raid.unknown_6, pdc->raid.unknown_6, pdc->raid.unknown_6);
185+
186+ for (disk = pdc->raid.disk, i = 0;
187+ i < pdc->raid.total_disks; disk++, i++) {
188+Index: b/1.0.0.rc16/lib/format/ataraid/pdc.h
189+===================================================================
190+--- a/1.0.0.rc16/lib/format/ataraid/pdc.h
191++++ b/1.0.0.rc16/lib/format/ataraid/pdc.h
192+@@ -61,12 +61,14 @@
193+ uint8_t raid0_shift; /* 0x221 */
194+ uint8_t raid0_disks; /* 0x222 */
195+ uint8_t array_number; /* 0x223 */
196+- uint32_t total_secs; /* 0x224 - 0x227 */
197++ uint32_t total_secs_l; /* 0x224 - 0x227 */
198+ uint16_t cylinders; /* 0x228 - 0x229 */
199+ uint8_t heads; /* 0x22A */
200+ uint8_t sectors; /* 0x22B */
201+ uint32_t magic_1; /* 0x22C - 0x2EF */
202+- uint32_t unknown_5; /* 0x230 - 0x233 */
203++ uint16_t unknown_5; /* 0x230 - 0x231 */
204++ uint8_t total_secs_h; /* 0x232 */
205++ uint8_t unknown_6; /* 0x233 */
206+ struct pdc_disk {
207+ uint16_t unknown_0; /* 0x234 - 0x235 */
208+ uint8_t channel; /* 0x236 */
209
210=== added file 'debian/patches/23_pdc_dump_extended_metadata.patch'
211--- debian/patches/23_pdc_dump_extended_metadata.patch 1970-01-01 00:00:00 +0000
212+++ debian/patches/23_pdc_dump_extended_metadata.patch 2011-03-24 00:42:46 +0000
213@@ -0,0 +1,153 @@
214+From: Phillip Susi <psusi@cfl.rr.com>
215+Last-Update: 2011-03-08
216+Forwarded: Yes
217+Description: PDC supports up to 4 sets of metadata to describe
218+ different arrays. Only the first set was being dumped with
219+ dmraid -rD or -n. This patch corrects that. Also fixes the
220+ .offset file, which was always reporting 0.
221+
222+Index: b/1.0.0.rc16/lib/format/ataraid/pdc.c
223+===================================================================
224+--- a/1.0.0.rc16/lib/format/ataraid/pdc.c
225++++ b/1.0.0.rc16/lib/format/ataraid/pdc.c
226+@@ -172,7 +172,6 @@
227+ unsigned *s = end_sectors;
228+ uint64_t sector;
229+
230+- *size = sizeof(*ret);
231+ pdc_sectors_max = di->sectors - div_up(*size, 512);
232+
233+ if (!(ret = alloc_private(lc, handler,
234+@@ -222,7 +221,9 @@
235+ dbg_free(ret);
236+ ret = NULL;
237+ }
238+-
239++ *size = sizeof(*ret) * ma;
240++ *offset = di->sectors - info->u32;
241++ *offset <<= 9;
242+ return ret;
243+ }
244+
245+@@ -547,63 +548,67 @@
246+ static void
247+ _pdc_log(struct lib_context *lc, struct dev_info *di, struct pdc *pdc)
248+ {
249+- unsigned i;
250++ unsigned i, ma = count_meta_areas(pdc);
251+ struct pdc_disk *disk;
252+
253+- log_print(lc, "%s (%s):", di->path, handler);
254+- DP("promise_id: \"%s\"", pdc, pdc->promise_id);
255+- P("unknown_0: 0x%x %u",
256+- pdc, pdc->unknown_0, pdc->unknown_0, pdc->unknown_0);
257+- DP("magic_0: 0x%x", pdc, pdc->magic_0);
258+- P("unknown_1: 0x%x %u",
259+- pdc, pdc->unknown_1, pdc->unknown_1, pdc->unknown_1);
260+- DP("magic_1: 0x%x", pdc, pdc->magic_1);
261+- P("unknown_2: 0x%x %u",
262+- pdc, pdc->unknown_2, pdc->unknown_2, pdc->unknown_2);
263+- DP("raid.flags: 0x%x", pdc, pdc->raid.flags);
264+- P("raid.unknown_0: 0x%x %d",
265+- pdc, pdc->raid.unknown_0, pdc->raid.unknown_0, pdc->raid.unknown_0);
266+- DP("raid.disk_number: %u", pdc, pdc->raid.disk_number);
267+- DP("raid.channel: %u", pdc, pdc->raid.channel);
268+- DP("raid.device: %u", pdc, pdc->raid.device);
269+- DP("raid.magic_0: 0x%x", pdc, pdc->raid.magic_0);
270+- P("raid.unknown_1: 0x%x %u",
271+- pdc, pdc->raid.unknown_1, pdc->raid.unknown_1, pdc->raid.unknown_1);
272+- P("raid.start: 0x%x %u",
273+- pdc, pdc->raid.start, pdc->raid.start, pdc->raid.start);
274+- DP("raid.disk_secs: %u", pdc, pdc->raid.disk_secs);
275+- P("raid.unknown_3: 0x%x %u",
276+- pdc, pdc->raid.unknown_3, pdc->raid.unknown_3, pdc->raid.unknown_3);
277+- P("raid.unknown_4: 0x%x %u",
278+- pdc, pdc->raid.unknown_4, pdc->raid.unknown_4, pdc->raid.unknown_4);
279+- DP("raid.status: 0x%x", pdc, pdc->raid.status);
280+- DP("raid.type: 0x%x", pdc, pdc->raid.type);
281+- DP("raid.total_disks: %u", pdc, pdc->raid.total_disks);
282+- DP("raid.raid0_shift: %u", pdc, pdc->raid.raid0_shift);
283+- DP("raid.raid0_disks: %u", pdc, pdc->raid.raid0_disks);
284+- DP("raid.array_number: %u", pdc, pdc->raid.array_number);
285+- DP("raid.total_secs_h: %u", pdc, pdc->raid.total_secs_h);
286+- DP("raid.total_secs_l: %u", pdc, pdc->raid.total_secs_l);
287+- DP("raid.cylinders: %u", pdc, pdc->raid.cylinders);
288+- DP("raid.heads: %u", pdc, pdc->raid.heads);
289+- DP("raid.sectors: %u", pdc, pdc->raid.sectors);
290+- DP("raid.magic_1: 0x%x", pdc, pdc->raid.magic_1);
291+- P("raid.unknown_5: 0x%x %u",
292+- pdc, pdc->raid.unknown_5, pdc->raid.unknown_5, pdc->raid.unknown_5);
293+- P("raid.unknown_6: 0x%x %u",
294+- pdc, pdc->raid.unknown_6, pdc->raid.unknown_6, pdc->raid.unknown_6);
295+-
296+- for (disk = pdc->raid.disk, i = 0;
297+- i < pdc->raid.total_disks; disk++, i++) {
298+- P2("raid.disk[%d].unknown_0: 0x%x", pdc, i, disk->unknown_0);
299+- P2("raid.disk[%d].channel: %u", pdc, i, disk->channel);
300+- P2("raid.disk[%d].device: %u", pdc, i, disk->device);
301+- P2("raid.disk[%d].magic_0: 0x%x", pdc, i, disk->magic_0);
302+- P2("raid.disk[%d].disk_number: %u", pdc, i, disk->disk_number);
303+- }
304++ while (ma) {
305++ log_print(lc, "%s (%s):", di->path, handler);
306++ Dp("promise_id: \"%s\"", pdc, pdc->promise_id);
307++ P("unknown_0: 0x%x %u",
308++ pdc, pdc->unknown_0, pdc->unknown_0, pdc->unknown_0);
309++ DP("magic_0: 0x%x", pdc, pdc->magic_0);
310++ P("unknown_1: 0x%x %u",
311++ pdc, pdc->unknown_1, pdc->unknown_1, pdc->unknown_1);
312++ DP("magic_1: 0x%x", pdc, pdc->magic_1);
313++ P("unknown_2: 0x%x %u",
314++ pdc, pdc->unknown_2, pdc->unknown_2, pdc->unknown_2);
315++ DP("raid.flags: 0x%x", pdc, pdc->raid.flags);
316++ P("raid.unknown_0: 0x%x %d",
317++ pdc, pdc->raid.unknown_0, pdc->raid.unknown_0, pdc->raid.unknown_0);
318++ DP("raid.disk_number: %u", pdc, pdc->raid.disk_number);
319++ DP("raid.channel: %u", pdc, pdc->raid.channel);
320++ DP("raid.device: %u", pdc, pdc->raid.device);
321++ DP("raid.magic_0: 0x%x", pdc, pdc->raid.magic_0);
322++ P("raid.unknown_1: 0x%x %u",
323++ pdc, pdc->raid.unknown_1, pdc->raid.unknown_1, pdc->raid.unknown_1);
324++ P("raid.start: 0x%x %u",
325++ pdc, pdc->raid.start, pdc->raid.start, pdc->raid.start);
326++ DP("raid.disk_secs: %u", pdc, pdc->raid.disk_secs);
327++ P("raid.unknown_3: 0x%x %u",
328++ pdc, pdc->raid.unknown_3, pdc->raid.unknown_3, pdc->raid.unknown_3);
329++ P("raid.unknown_4: 0x%x %u",
330++ pdc, pdc->raid.unknown_4, pdc->raid.unknown_4, pdc->raid.unknown_4);
331++ DP("raid.status: 0x%x", pdc, pdc->raid.status);
332++ DP("raid.type: 0x%x", pdc, pdc->raid.type);
333++ DP("raid.total_disks: %u", pdc, pdc->raid.total_disks);
334++ DP("raid.raid0_shift: %u", pdc, pdc->raid.raid0_shift);
335++ DP("raid.raid0_disks: %u", pdc, pdc->raid.raid0_disks);
336++ DP("raid.array_number: %u", pdc, pdc->raid.array_number);
337++ DP("raid.total_secs_h: %u", pdc, pdc->raid.total_secs_h);
338++ DP("raid.total_secs_l: %u", pdc, pdc->raid.total_secs_l);
339++ DP("raid.cylinders: %u", pdc, pdc->raid.cylinders);
340++ DP("raid.heads: %u", pdc, pdc->raid.heads);
341++ DP("raid.sectors: %u", pdc, pdc->raid.sectors);
342++ DP("raid.magic_1: 0x%x", pdc, pdc->raid.magic_1);
343++ P("raid.unknown_5: 0x%x %u",
344++ pdc, pdc->raid.unknown_5, pdc->raid.unknown_5, pdc->raid.unknown_5);
345++ P("raid.unknown_6: 0x%x %u",
346++ pdc, pdc->raid.unknown_6, pdc->raid.unknown_6, pdc->raid.unknown_6);
347++
348++ for (disk = pdc->raid.disk, i = 0;
349++ i < pdc->raid.total_disks; disk++, i++) {
350++ P2("raid.disk[%d].unknown_0: 0x%x", pdc, i, disk->unknown_0);
351++ P2("raid.disk[%d].channel: %u", pdc, i, disk->channel);
352++ P2("raid.disk[%d].device: %u", pdc, i, disk->device);
353++ P2("raid.disk[%d].magic_0: 0x%x", pdc, i, disk->magic_0);
354++ P2("raid.disk[%d].disk_number: %u", pdc, i, disk->disk_number);
355++ }
356+
357+- P("checksum: 0x%x %s", pdc, pdc->checksum, pdc->checksum,
358+- checksum(pdc) ? "Ok" : "BAD");
359++ P("checksum: 0x%x %s", pdc, pdc->checksum, pdc->checksum,
360++ checksum(pdc) ? "Ok" : "BAD");
361++ ma--;
362++ pdc++;
363++ }
364+ }
365+
366+ static void
367
368=== added file 'debian/patches/24_drop_p_for_partition_conditional.patch'
369--- debian/patches/24_drop_p_for_partition_conditional.patch 1970-01-01 00:00:00 +0000
370+++ debian/patches/24_drop_p_for_partition_conditional.patch 2011-03-24 00:42:46 +0000
371@@ -0,0 +1,31 @@
372+From: Phillip Susi <psusi@cfl.rr.com>
373+Last-Update: 2011-03-08
374+Description: dmraid was changed at one point to insert a 'p' between
375+ the base device name and the partition number. For some time
376+ debian and ubuntu reversed this change. This patch modifies the
377+ behavior to add the 'p' iff the last character of the base name is
378+ a digit. This makes dmraid comply with the behavior used by
379+ kpartx and "by linux since the dawn of time".
380+Forwarded: Yes
381+
382+Index: b/1.0.0.rc16/lib/format/partition/dos.c
383+===================================================================
384+--- a/1.0.0.rc16/lib/format/partition/dos.c
385++++ b/1.0.0.rc16/lib/format/partition/dos.c
386+@@ -31,8 +31,14 @@
387+ {
388+ const char *base = get_basename(lc, rd->di->path);
389+
390+- return type ? snprintf(str, len, "%s%s%u", base, OPT_STR_PARTCHAR(lc),
391+- partition) : snprintf(str, len, "%s", base);
392++ if (type)
393++ {
394++ if (isdigit(base[strlen(base) - 1]))
395++ return snprintf(str, len, "%s%s%u", base,
396++ OPT_STR_PARTCHAR(lc), partition);
397++ else return snprintf(str, len, "%s%u", base, partition);
398++ }
399++ else return snprintf(str, len, "%s", base);
400+ }
401+
402+ static char *
403
404=== modified file 'debian/patches/series'
405--- debian/patches/series 2010-11-07 17:34:24 +0000
406+++ debian/patches/series 2011-03-24 00:42:46 +0000
407@@ -9,3 +9,8 @@
408 18_pdc_raid10_failure..patch
409 19_ddf1_lsi_persistent_name.patch
410 20_fix_isw_sectors_calculation.patch
411+21_jmicron_namefix.patch
412+21_fix_testing.patch
413+22_add_pdc_64bit_addressing.patch
414+23_pdc_dump_extended_metadata.patch
415+24_drop_p_for_partition_conditional.patch

Subscribers

People subscribed via source and target branches

to all changes: