Merge ~paelzer/ubuntu/+source/multipath-tools:lp-1891202-sgio_get_vpd-handling into ubuntu/+source/multipath-tools:ubuntu/bionic-devel

Proposed by Christian Ehrhardt 
Status: Merged
Approved by: Christian Ehrhardt 
Approved revision: 1572e78316e9cfdf4473af7363173fc538cd862a
Merge reported by: Christian Ehrhardt 
Merged at revision: 1572e78316e9cfdf4473af7363173fc538cd862a
Proposed branch: ~paelzer/ubuntu/+source/multipath-tools:lp-1891202-sgio_get_vpd-handling
Merge into: ubuntu/+source/multipath-tools:ubuntu/bionic-devel
Diff against target: 223 lines (+183/-0)
6 files modified
debian/changelog (+7/-0)
debian/patches/lp-1891202-libmultipath-Fix-sgio_get_vpd.patch (+55/-0)
debian/patches/lp-1891202-libmultipath-fix-return-code-of-sgio_get_vpd.patch (+32/-0)
debian/patches/lp-1891202-libmultipath-get_vpd_sgio-support-VPD-0xc9.patch (+35/-0)
debian/patches/lp-1891202-libmultipath-sgio_get_vpd-add-page-argument.patch (+50/-0)
debian/patches/series (+4/-0)
Reviewer Review Type Date Requested Status
Bryce Harrington (community) Needs Information
Canonical Server Pending
Canonical Server packageset reviewers Pending
Review via email: mp+392693@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :
Revision history for this message
Bryce Harrington (bryce) wrote :
Download full text (4.2 KiB)

* Changelog:
  - [-] old content and logical tag match as expected
  - [√] changelog entry correct version and targeted codename
  - [√] changelog entries correct
  - [√] update-maintainer has been run

* Actual changes:
  - [-] no upstream changes to consider
  - [-] no further upstream version to consider
  - [√] debian changes look safe

* Old Delta:
  - [-] dropped changes are ok to be dropped
  - [-] nothing else to drop
  - [√] changes forwarded upstream/debian (if appropriate)

* New Delta:
  - [-] no new patches added
  - [√] patches match what was proposed upstream
  - [√] patches correctly included in debian/patches/series
  - [√] patches have correct DEP3 metadata

* Build/Test:
  - [√] build is ok
  - [√] verified PPA package installs/uninstalls
  - [x] autopkgtest against the PPA package passes
  - [x] sanity checks test fine

The patches look ok to me (I only did a brief skim), and the package builds ok in bileto, but on installation in a bionic lxc amd64 container I got a failure activating the service:

Setting up multipath-tools (0.7.4-2ubuntu3.1~ppa1) ...
Created symlink /etc/systemd/system/multipath-tools.service → /lib/systemd/system/multipathd.service.
Created symlink /etc/systemd/system/sysinit.target.wants/multipathd.service → /lib/systemd/system/multipathd.service.
multipathd.socket is a disabled or a static unit, not starting it.
Job for multipathd.service failed because the control process exited with error code.
See "systemctl status multipathd.service" and "journalctl -xe" for details.
invoke-rc.d: initscript multipath-tools, action "start" failed.
● multipathd.service - Device-Mapper Multipath Device Controller
   Loaded: loaded (/lib/systemd/system/multipathd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2020-10-24 00:42:45 UTC; 17ms ago
  Process: 1929 ExecStart=/sbin/multipathd -d -s (code=exited, status=1/FAILURE)
  Process: 1928 ExecStartPre=/sbin/modprobe -a scsi_dh_alua scsi_dh_emc scsi_dh_rdac dm-multipath (code=exited, status=1/FAILURE)
 Main PID: 1929 (code=exited, status=1/FAILURE)
   Status: "configure"

Oct 24 00:42:45 multipath-tools-review-mp392693-sgio-bionic multipathd[1929]: read /etc/multipath.conf
Oct 24 00:42:45 multipath-tools-review-mp392693-sgio-bionic multipathd[1929]: path checkers start up
Oct 24 00:42:45 multipath-tools-review-mp392693-sgio-bionic multipathd[1929]: failed to increase buffer size
Oct 24 00:42:45 multipath-tools-review-mp392693-sgio-bionic multipathd[1929]: /dev/mapper/control: mknod failed: Operation not permitted
Oct 24 00:42:45 multipath-tools-review-mp392693-sgio-bionic multipathd[1929]: Failure to communicate with kernel device-mapper driver.
Oct 24 00:42:45 multipath-tools-review-mp392693-sgio-bionic multipathd[1929]: Check that device-mapper is available in the kernel.
Oct 24 00:42:45 multipath-tools-review-mp392693-sgio-bionic multipathd[1929]: Incompatible libdevmapper 1.02.145 (2017-11-03) and kernel driver (unknown version).
Oct 24 00:42:45 multipath-tools-review-mp392693-sgio-bionic systemd[1]: multipathd.service: Main process exited, code=exited, status=1/FAILURE
Oct 24 00:42:45 multipath-tools-review-mp392693-sgio...

Read more...

review: Needs Information
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

That container fail is a correct one and not related to the update.
It just happens to fail to talk to the kernel device mapper.
Pre-Fix behaves just the same.

In a VM or BareMetal system it (the PPA build) works fine.

The underlying issue is fixed in later releases
There it isn't trying to start in containers.

root@f:~# systemctl status multipathd
● multipathd.service - Device-Mapper Multipath Device Controller
     Loaded: loaded (/lib/systemd/system/multipathd.service; enabled; vendor preset: enabled)
     Active: inactive (dead)
TriggeredBy: ● multipathd.socket
  Condition: start condition failed at Fri 2020-10-23 09:42:34 UTC; 2 days ago
             └─ ConditionVirtualization=!container was not met

This was not SRUed as one could try to tweak both ways.
A Bionic user could have exposed d/m/control and an update "fixing this" would break him.
On the upgrade to Focal this would be ok to change and those who want to enable there can override the unit to do so.
Therefore this is all fine as it is.

Thanks for the thought thou, always better to re-check such things.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

To ssh://git.launchpad.net/~usd-import-team/ubuntu/+source/multipath-tools
 * [new tag] upload/0.7.4-2ubuntu3.1 -> upload/0.7.4-2ubuntu3.1

Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading multipath-tools_0.7.4-2ubuntu3.1.dsc: done.
  Uploading multipath-tools_0.7.4-2ubuntu3.1.debian.tar.xz: done.
  Uploading multipath-tools_0.7.4-2ubuntu3.1_source.buildinfo: done.
  Uploading multipath-tools_0.7.4-2ubuntu3.1_source.changes: done.
Successfully uploaded packages.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

I have re-uploaded this again ... but in terms of an MP this one is merged and can be removed from our MP overview.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index d63df56..c53c62b 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+multipath-tools (0.7.4-2ubuntu3.1) bionic; urgency=medium
7+
8+ * d/p/lp-1891202-*: fix handling of sgio_get_vpd for e.g. long iscsi target
9+ names as generated by NetApp E-Series RDAC (LP: #1891202)
10+
11+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Mon, 28 Sep 2020 16:14:24 +0200
12+
13 multipath-tools (0.7.4-2ubuntu3) bionic; urgency=medium
14
15 * d/p/kpartx-print-loop-deleted-to-stdout-not-stderr.patch: Print loop
16diff --git a/debian/patches/lp-1891202-libmultipath-Fix-sgio_get_vpd.patch b/debian/patches/lp-1891202-libmultipath-Fix-sgio_get_vpd.patch
17new file mode 100644
18index 0000000..6790e67
19--- /dev/null
20+++ b/debian/patches/lp-1891202-libmultipath-Fix-sgio_get_vpd.patch
21@@ -0,0 +1,55 @@
22+From 1f401b69e478b35d4b54b1980be67943c6d61d9f Mon Sep 17 00:00:00 2001
23+From: Bart Van Assche <bart.vanassche@wdc.com>
24+Date: Thu, 8 Mar 2018 00:15:48 +0100
25+Subject: [PATCH] libmultipath: Fix sgio_get_vpd()
26+
27+Pass the VPD page number to sgio_get_vpd() such that the page needed
28+by the caller is queried instead of page 0x83. Fix the statement that
29+computes the length of the page returned by do_inq(). Fix the return
30+code check in the caller of sgio_get_vpd().
31+
32+Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
33+Signed-off-by: Martin Wilck <mwilck@suse.com>
34+
35+Origin: upstream, https://git.opensvc.com/gitweb.cgi?p=multipath-tools/.git;a=commit;h=1f401b69e
36+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1891202
37+Last-Update: 2020-09-28
38+
39+---
40+ libmultipath/discovery.c | 6 ++++--
41+ 1 file changed, 4 insertions(+), 2 deletions(-)
42+
43+diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
44+index 71c75872c..23e99f05b 100644
45+--- a/libmultipath/discovery.c
46++++ b/libmultipath/discovery.c
47+@@ -837,6 +837,8 @@ detect_alua(struct path * pp, struct config *conf)
48+
49+ #define DEFAULT_SGIO_LEN 254
50+
51++/* Query VPD page @pg. Returns number of INQUIRY bytes
52++ upon success and -1 upon failure. */
53+ static int
54+ sgio_get_vpd (unsigned char * buff, int maxlen, int fd, int pg)
55+ {
56+@@ -848,7 +850,7 @@ sgio_get_vpd (unsigned char * buff, int maxlen, int fd, int pg)
57+ }
58+ retry:
59+ if (0 == do_inq(fd, 0, 1, pg, buff, len)) {
60+- len = buff[3] + (buff[2] << 8);
61++ len = buff[3] + (buff[2] << 8) + 4;
62+ if (len >= maxlen)
63+ return len;
64+ if (len > DEFAULT_SGIO_LEN)
65+@@ -1100,7 +1102,7 @@ get_vpd_sgio (int fd, int pg, char * str, int maxlen)
66+ unsigned char buff[4096];
67+
68+ memset(buff, 0x0, 4096);
69+- if (sgio_get_vpd(buff, 4096, fd, pg) <= 0) {
70++ if (sgio_get_vpd(buff, 4096, fd, pg) < 0) {
71+ condlog(3, "failed to issue vpd inquiry for pg%02x",
72+ pg);
73+ return -errno;
74+--
75+2.28.0
76+
77diff --git a/debian/patches/lp-1891202-libmultipath-fix-return-code-of-sgio_get_vpd.patch b/debian/patches/lp-1891202-libmultipath-fix-return-code-of-sgio_get_vpd.patch
78new file mode 100644
79index 0000000..6ee3b2f
80--- /dev/null
81+++ b/debian/patches/lp-1891202-libmultipath-fix-return-code-of-sgio_get_vpd.patch
82@@ -0,0 +1,32 @@
83+From c6140952d1b682261c07cdb7138c944ee83d8809 Mon Sep 17 00:00:00 2001
84+From: Martin Wilck <mwilck@suse.com>
85+Date: Sat, 13 Jan 2018 22:19:23 +0100
86+Subject: [PATCH] libmultipath: fix return code of sgio_get_vpd()
87+
88+This function must return the length of data received in success
89+case.
90+
91+Origin: upstream, https://git.opensvc.com/gitweb.cgi?p=multipath-tools/.git;a=commit;h=c6140952d
92+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1891202
93+Last-Update: 2020-09-28
94+
95+---
96+ libmultipath/discovery.c | 2 +-
97+ 1 file changed, 1 insertion(+), 1 deletion(-)
98+
99+diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
100+index ab7794d8d..c53d3aab8 100644
101+--- a/libmultipath/discovery.c
102++++ b/libmultipath/discovery.c
103+@@ -852,7 +852,7 @@ retry:
104+ return len;
105+ if (len > DEFAULT_SGIO_LEN)
106+ goto retry;
107+- return 0;
108++ return len;
109+ }
110+ return -1;
111+ }
112+--
113+2.28.0
114+
115diff --git a/debian/patches/lp-1891202-libmultipath-get_vpd_sgio-support-VPD-0xc9.patch b/debian/patches/lp-1891202-libmultipath-get_vpd_sgio-support-VPD-0xc9.patch
116new file mode 100644
117index 0000000..f26664d
118--- /dev/null
119+++ b/debian/patches/lp-1891202-libmultipath-get_vpd_sgio-support-VPD-0xc9.patch
120@@ -0,0 +1,35 @@
121+From 9d0e6bffbb3e490e92cf91444cfeb4177d540707 Mon Sep 17 00:00:00 2001
122+From: Martin Wilck <mwilck@suse.com>
123+Date: Sat, 13 Jan 2018 22:19:25 +0100
124+Subject: [PATCH] libmultipath: get_vpd_sgio: support VPD 0xc9
125+
126+This VPD is needed to check for NetApp E-Series RDAC support.
127+
128+Origin: upstream, https://git.opensvc.com/gitweb.cgi?p=multipath-tools/.git;a=commit;h=9d0e6bffb
129+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1891202
130+Last-Update: 2020-09-28
131+
132+---
133+ libmultipath/discovery.c | 6 +++++-
134+ 1 file changed, 5 insertions(+), 1 deletion(-)
135+
136+diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
137+index 43631c46f..8ae170ee3 100644
138+--- a/libmultipath/discovery.c
139++++ b/libmultipath/discovery.c
140+@@ -1118,7 +1118,11 @@ get_vpd_sgio (int fd, int pg, char * str, int maxlen)
141+ len = parse_vpd_pg80(buff, str, maxlen);
142+ else if (pg == 0x83)
143+ len = parse_vpd_pg83(buff, buff_len, str, maxlen);
144+- else
145++ else if (pg == 0xc9 && maxlen >= 8) {
146++ len = buff_len < 8 ? -ENODATA :
147++ (buff_len <= maxlen ? buff_len : maxlen);
148++ memcpy (str, buff, len);
149++ } else
150+ len = -ENOSYS;
151+
152+ return len;
153+--
154+2.28.0
155+
156diff --git a/debian/patches/lp-1891202-libmultipath-sgio_get_vpd-add-page-argument.patch b/debian/patches/lp-1891202-libmultipath-sgio_get_vpd-add-page-argument.patch
157new file mode 100644
158index 0000000..4b19b2d
159--- /dev/null
160+++ b/debian/patches/lp-1891202-libmultipath-sgio_get_vpd-add-page-argument.patch
161@@ -0,0 +1,50 @@
162+From d74a79f3590f3f28d34287b64c565fd5bf9705d0 Mon Sep 17 00:00:00 2001
163+From: Martin Wilck <mwilck@suse.com>
164+Date: Sat, 13 Jan 2018 22:19:24 +0100
165+Subject: [PATCH] libmultipath: sgio_get_vpd: add page argument
166+
167+get_vpd_sgio() assumes to be able to send different VPD inquires.
168+This requires passing the pg argument to sgio_get_vpd().
169+
170+Origin: upstream, https://git.opensvc.com/gitweb.cgi?p=multipath-tools/.git;a=commit;h=d74a79f35
171+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1891202
172+Last-Update: 2020-09-28
173+
174+---
175+ libmultipath/discovery.c | 6 +++---
176+ 1 file changed, 3 insertions(+), 3 deletions(-)
177+
178+diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
179+index c53d3aab8..43631c46f 100644
180+--- a/libmultipath/discovery.c
181++++ b/libmultipath/discovery.c
182+@@ -837,7 +837,7 @@ detect_alua(struct path * pp, struct config *conf)
183+ #define DEFAULT_SGIO_LEN 254
184+
185+ static int
186+-sgio_get_vpd (unsigned char * buff, int maxlen, int fd)
187++sgio_get_vpd (unsigned char * buff, int maxlen, int fd, int pg)
188+ {
189+ int len = DEFAULT_SGIO_LEN;
190+
191+@@ -846,7 +846,7 @@ sgio_get_vpd (unsigned char * buff, int maxlen, int fd)
192+ return -1;
193+ }
194+ retry:
195+- if (0 == do_inq(fd, 0, 1, 0x83, buff, len)) {
196++ if (0 == do_inq(fd, 0, 1, pg, buff, len)) {
197+ len = buff[3] + (buff[2] << 8);
198+ if (len >= maxlen)
199+ return len;
200+@@ -1099,7 +1099,7 @@ get_vpd_sgio (int fd, int pg, char * str, int maxlen)
201+ unsigned char buff[4096];
202+
203+ memset(buff, 0x0, 4096);
204+- if (sgio_get_vpd(buff, 4096, fd) <= 0) {
205++ if (sgio_get_vpd(buff, 4096, fd, pg) <= 0) {
206+ condlog(3, "failed to issue vpd inquiry for pg%02x",
207+ pg);
208+ return -errno;
209+--
210+2.28.0
211+
212diff --git a/debian/patches/series b/debian/patches/series
213index 61f388a..e1c6497 100644
214--- a/debian/patches/series
215+++ b/debian/patches/series
216@@ -16,3 +16,7 @@ enable-find-multipaths.patch
217 RH-trigger-change-uevent-on-new-device-creation.patch
218 kpartx-Improve-finding-loopback-device-by-file.patch
219 kpartx-print-loop-deleted-to-stdout-not-stderr.patch
220+lp-1891202-libmultipath-fix-return-code-of-sgio_get_vpd.patch
221+lp-1891202-libmultipath-sgio_get_vpd-add-page-argument.patch
222+lp-1891202-libmultipath-get_vpd_sgio-support-VPD-0xc9.patch
223+lp-1891202-libmultipath-Fix-sgio_get_vpd.patch

Subscribers

People subscribed via source and target branches