Merge lp:~psusi/ubuntu/precise/multipath-tools/fix-dmraid-extended-partitions into lp:ubuntu/precise/multipath-tools

Proposed by Phillip Susi
Status: Merged
Merge reported by: Dimitri John Ledkov
Merged at revision: not available
Proposed branch: lp:~psusi/ubuntu/precise/multipath-tools/fix-dmraid-extended-partitions
Merge into: lp:ubuntu/precise/multipath-tools
Diff against target: 124 lines (+61/-6)
6 files modified
.pc/applied-patches (+1/-0)
debian/changelog (+7/-0)
debian/patches/0010-fix-extended-partitions.patch (+47/-0)
debian/patches/series (+1/-0)
kpartx/dos.c (+2/-0)
kpartx/kpartx.c (+3/-6)
To merge this branch: bzr merge lp:~psusi/ubuntu/precise/multipath-tools/fix-dmraid-extended-partitions
Reviewer Review Type Date Requested Status
Iain Lane Approve
Stefan Bader (community) Approve
Ubuntu branches Pending
Review via email: mp+166079@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Stefan Bader (smb) wrote :

Clean cherry-pick from Saucy. Looks correct to me.

review: Approve
Revision history for this message
Iain Lane (laney) wrote :

Merci, uploaded

review: Approve
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

setting to merged, to remove from sponsorship report. The package is still in precise unapproved queue.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.pc/applied-patches'
2--- .pc/applied-patches 2012-01-09 04:04:07 +0000
3+++ .pc/applied-patches 2013-05-28 15:25:36 +0000
4@@ -9,3 +9,4 @@
5 1000--set-umask-in-multipathd.patch
6 1001--fix-linking-command.patch
7 0009-fix-delim.patch
8+0010-fix-extended-partitions.patch
9
10=== modified file 'debian/changelog'
11--- debian/changelog 2012-03-20 15:26:22 +0000
12+++ debian/changelog 2013-05-28 15:25:36 +0000
13@@ -1,3 +1,10 @@
14+multipath-tools (0.4.9-3ubuntu5.1) precise; urgency=low
15+
16+ * Add 0010-fix-extended-partitions.patch: Only expose the
17+ first two sectors of the extended partition (LP: #1093918).
18+
19+ -- Phillip Susi <psusi@ubuntu.com> Tue, 28 May 2013 11:14:46 -0400
20+
21 multipath-tools (0.4.9-3ubuntu5) precise; urgency=low
22
23 * Split kpartx initramfs bits into kpartx-boot for dmraid (LP: #941874)
24
25=== added file 'debian/patches/0010-fix-extended-partitions.patch'
26--- debian/patches/0010-fix-extended-partitions.patch 1970-01-01 00:00:00 +0000
27+++ debian/patches/0010-fix-extended-partitions.patch 2013-05-28 15:25:36 +0000
28@@ -0,0 +1,47 @@
29+From: Phillip Susi <psusi@ubuntu.com>
30+Subject: fix extended partition mapping
31+Description: The linux kernel maps the extended partition only
32+ so that LILO can be installed there. The length is always set
33+ to two sectors to allow this, and most tools know to ignore the
34+ device. kpartx was mapping the entire extended partition, then
35+ stacking the logical partitions on top of it. This presented
36+ a device that looked like an entirely separate disk that
37+ contains only the logical partitions. This patch fixes kpartx
38+ to conform with the normal Linux behavior.
39+
40+--- a/kpartx/dos.c
41++++ b/kpartx/dos.c
42+@@ -98,6 +98,8 @@
43+ break;
44+ }
45+ if (is_extended(p.sys_type)) {
46++ sp[i].size = 2; /* extended partitions only get two
47++ sectors mapped for LILO to install */
48+ n += read_extended_partition(fd, &p, i, sp+n, ns-n);
49+ }
50+ }
51+--- a/kpartx/kpartx.c
52++++ b/kpartx/kpartx.c
53+@@ -501,7 +501,6 @@
54+ d = c;
55+ while (c) {
56+ for (j = 0; j < n; j++) {
57+- uint64_t start;
58+ int k = slices[j].container - 1;
59+
60+ if (slices[j].size == 0)
61+@@ -527,11 +526,9 @@
62+ }
63+ strip_slash(partname);
64+
65+- start = slices[j].start - slices[k].start;
66+- if (safe_sprintf(params, "%d:%d %" PRIu64,
67+- slices[k].major,
68+- slices[k].minor,
69+- start)) {
70++ if (safe_sprintf(params, "%s %" PRIu64,
71++ device,
72++ slices[j].start)) {
73+ fprintf(stderr, "params too small\n");
74+ exit(1);
75+ }
76
77=== modified file 'debian/patches/series'
78--- debian/patches/series 2012-01-09 04:04:07 +0000
79+++ debian/patches/series 2013-05-28 15:25:36 +0000
80@@ -9,3 +9,4 @@
81 1000--set-umask-in-multipathd.patch
82 1001--fix-linking-command.patch
83 0009-fix-delim.patch
84+0010-fix-extended-partitions.patch
85
86=== modified file 'kpartx/dos.c'
87--- kpartx/dos.c 2009-02-12 15:07:42 +0000
88+++ kpartx/dos.c 2013-05-28 15:25:36 +0000
89@@ -98,6 +98,8 @@
90 break;
91 }
92 if (is_extended(p.sys_type)) {
93+ sp[i].size = 2; /* extended partitions only get two
94+ sectors mapped for LILO to install */
95 n += read_extended_partition(fd, &p, i, sp+n, ns-n);
96 }
97 }
98
99=== modified file 'kpartx/kpartx.c'
100--- kpartx/kpartx.c 2012-01-09 04:04:07 +0000
101+++ kpartx/kpartx.c 2013-05-28 15:25:36 +0000
102@@ -501,7 +501,6 @@
103 d = c;
104 while (c) {
105 for (j = 0; j < n; j++) {
106- uint64_t start;
107 int k = slices[j].container - 1;
108
109 if (slices[j].size == 0)
110@@ -527,11 +526,9 @@
111 }
112 strip_slash(partname);
113
114- start = slices[j].start - slices[k].start;
115- if (safe_sprintf(params, "%d:%d %" PRIu64,
116- slices[k].major,
117- slices[k].minor,
118- start)) {
119+ if (safe_sprintf(params, "%s %" PRIu64,
120+ device,
121+ slices[j].start)) {
122 fprintf(stderr, "params too small\n");
123 exit(1);
124 }

Subscribers

People subscribed via source and target branches

to all changes: