On Mon, Jan 15, 2018 at 01:29:40PM +0100, Julian Andres Klode wrote:
> On Fri, Jan 12, 2018 at 11:18:34PM +0100, Julian Andres Klode wrote:
> > On Thu, Jan 11, 2018 at 02:52:16PM +0100, Julian Andres Klode wrote:
> > > Package: multipath-tools
> > > Version: 0.7.4-2
> > > Severity: important
> > > User: ubuntu-de...@lists.ubuntu.com
> > > Usertags: origin-ubuntu ubuntu-patch
> > > Control: tag -1 patch
> > > 
> > > Hi, debian/rules does not install various udev rules, and some of the
> > > udev rules are broken. Also debian/rules does not properly run dh_clean
> > > at the end of the clean target.
> > > 
> > > I prepared a branch for you:
> > > 
> > >   pull https://git.launchpad.net/~juliank/+git/multipath-tools-debian 
> > > rules-fixes
> > > 
> > > with the following changes:
> > > 
> > > Julian Andres Klode (6):
> > >       Install dm-parts.rule
> > >       Fix /usr/lib/udev to be /lib/udev
> > >       Move udev rules at position 11 to position 56
> > >       Fix 11-dm-mpath.rules to check for DM_UDEV_RULES, not 
> > > DM_UDEV_RULES_VSN
> > >       d/rules: Run dh_clean from clean target
> > >       Install 68-del-part-nodes.rules
> > 
> > I pushed another fix from the upstream mailing list that makes the tgt...
> > autopkgtest pass.
> 

Another run of patches with some more headers.

-- 
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer                              i speak de, en
>From 8c2c5b1278865734984e6d57cb217895b0b1ddf7 Mon Sep 17 00:00:00 2001
From: Julian Andres Klode <julian.kl...@canonical.com>
Date: Wed, 10 Jan 2018 13:30:43 +0100
Subject: [PATCH 1/7] Move dm-mpath rules from position 11 to position 56

The rules in dm-mpath rely on dm.rules. Upstream installs dm.rules
at 10, but we install it at 55, so we have to move dm-mpath.rules
from 11 to 56.
---
 debian/rules | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/rules b/debian/rules
index eb22b316..2282910e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -124,7 +124,7 @@ binary-arch: build install
 	dh_installinit -pmultipath-tools
 	dh_installudev -pkpartx
 	dh_installudev -pmultipath-tools --name=multipath
-	dh_installudev -pmultipath-tools --name=dm-mpath --priority=11
+	dh_installudev -pmultipath-tools --name=dm-mpath --priority=56
 	dh_link -a lib/systemd/system/multipathd.service \
 		lib/systemd/system/multipath-tools.service
 	dh_systemd_start -pmultipath-tools multipathd.service
-- 
2.15.1

>From d576eb5de90fce51afb9cbc63c9a5c040245509b Mon Sep 17 00:00:00 2001
From: Julian Andres Klode <julian.kl...@canonical.com>
Date: Wed, 10 Jan 2018 13:29:33 +0100
Subject: [PATCH 2/7] Install dm-parts.rule

This requires some changes in the debian/rules files, because
the use of dh_udev is somewhat broken.
---
 debian/rules | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/debian/rules b/debian/rules
index 2282910e..3cfa67d3 100755
--- a/debian/rules
+++ b/debian/rules
@@ -29,6 +29,7 @@ build-indep:
 build-stamp: clean-tree
 	dh_testdir
 	
+	[ ! -f kpartx/dm-parts.rules ] || cp kpartx/dm-parts.rules debian/kpartx.dm-parts.udev
 	[ ! -f kpartx/kpartx.rules ] || cp kpartx/kpartx.rules debian/kpartx.udev
 	[ ! -f multipath/multipath.rules ] || cp multipath/multipath.rules debian/multipath.udev
 	[ ! -f multipath/11-dm-mpath.rules ] || cp multipath/11-dm-mpath.rules debian/dm-mpath.udev
@@ -123,6 +124,7 @@ binary-arch: build install
 	dh_systemd_enable -pmultipath-tools multipathd.service
 	dh_installinit -pmultipath-tools
 	dh_installudev -pkpartx
+	dh_installudev -pkpartx --name=dm-parts --priority=56
 	dh_installudev -pmultipath-tools --name=multipath
 	dh_installudev -pmultipath-tools --name=dm-mpath --priority=56
 	dh_link -a lib/systemd/system/multipathd.service \
-- 
2.15.1

>From a4645e103aa2fe14cd8ca29a311d4a235eeace98 Mon Sep 17 00:00:00 2001
From: Julian Andres Klode <julian.kl...@canonical.com>
Date: Wed, 10 Jan 2018 13:29:43 +0100
Subject: [PATCH 3/7] Fix /usr/lib/udev to be /lib/udev

Otherwise it does not find kpartx_id.
---
 debian/patches/fix-usrmerge-paths.patch | 27 +++++++++++++++++++++++++++
 debian/patches/series                   |  1 +
 2 files changed, 28 insertions(+)
 create mode 100644 debian/patches/fix-usrmerge-paths.patch

diff --git a/debian/patches/fix-usrmerge-paths.patch b/debian/patches/fix-usrmerge-paths.patch
new file mode 100644
index 00000000..78192a80
--- /dev/null
+++ b/debian/patches/fix-usrmerge-paths.patch
@@ -0,0 +1,27 @@
+From: Julian Andres Klode <julian.kl...@canonical.com>
+Date: Thu, 25 Jan 2018 12:02:55 +0100
+Subject: fix-usrmerge-paths
+
+Fix paths to use /lib/udev instead of /usr/lib/udev, since we have not
+done a usrmerge yet.
+
+Bug-Debian: https://bugs.debian.org/886938
+Forwarded: no
+Origin: vendor
+---
+ multipath/11-dm-mpath.rules | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/multipath/11-dm-mpath.rules b/multipath/11-dm-mpath.rules
+index 91d8058..c1d3f23 100644
+--- a/multipath/11-dm-mpath.rules
++++ b/multipath/11-dm-mpath.rules
+@@ -97,7 +97,7 @@ ENV{DM_UDEV_LOW_PRIORITY_FLAG}!="1", OPTIONS+="link_priority=50"
+ 
+ # kpartx_id is very robust, it works for suspended maps and maps
+ # with 0 dependencies. It sets DM_TYPE, DM_PART, DM_WWN
+-TEST=="/usr/lib/udev/kpartx_id", \
++TEST=="/lib/udev/kpartx_id", \
+ 	IMPORT{program}=="kpartx_id %M %m $env{DM_UUID}"
+ 
+ ENV{DM_TYPE}=="?*", SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_NAME}"
diff --git a/debian/patches/series b/debian/patches/series
index cc0c6d8f..dc2cd61c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,4 @@
 systemd-alias.patch
 disable-systemd-for-udeb.patch
 disable-rados-link-for-udeb-new.patch
+fix-usrmerge-paths.patch
-- 
2.15.1

>From dea4ce98b3e4afa48da751beef4691a5ec87181c Mon Sep 17 00:00:00 2001
From: Julian Andres Klode <julian.kl...@canonical.com>
Date: Wed, 10 Jan 2018 13:31:01 +0100
Subject: [PATCH 4/7] Fix 11-dm-mpath.rules to check for DM_UDEV_RULES, not
 DM_UDEV_RULES_VSN

We patch that in lvm2 to be named differently for who knows why.
---
 .../11-dm-mpath-fix-DM_UDEV_RULES_VSN-check.patch  | 26 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 2 files changed, 27 insertions(+)
 create mode 100644 debian/patches/11-dm-mpath-fix-DM_UDEV_RULES_VSN-check.patch

diff --git a/debian/patches/11-dm-mpath-fix-DM_UDEV_RULES_VSN-check.patch b/debian/patches/11-dm-mpath-fix-DM_UDEV_RULES_VSN-check.patch
new file mode 100644
index 00000000..63b7087a
--- /dev/null
+++ b/debian/patches/11-dm-mpath-fix-DM_UDEV_RULES_VSN-check.patch
@@ -0,0 +1,26 @@
+From: Julian Andres Klode <julian.kl...@canonical.com>
+Date: Thu, 25 Jan 2018 12:02:55 +0100
+Subject: 11-dm-mpath: fix DM_UDEV_RULES_VSN-check
+
+Fix 11-dm-mpath.rules to check for DM_UDEV_RULES, not DM_UDEV_RULES_VSN
+
+We patch that in lvm2 to be named differently for who knows why.
+
+Bug-Debian: https://bugs.debian.org/886938
+Forwarded: not-needed
+Origin: vendor
+---
+ multipath/11-dm-mpath.rules | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/multipath/11-dm-mpath.rules b/multipath/11-dm-mpath.rules
+index c1d3f23..fbe958d 100644
+--- a/multipath/11-dm-mpath.rules
++++ b/multipath/11-dm-mpath.rules
+@@ -1,5 +1,5 @@
+ ACTION!="add|change", GOTO="mpath_end"
+-ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="mpath_end"
++ENV{DM_UDEV_RULES}!="?*", GOTO="mpath_end"
+ ENV{DM_UUID}!="mpath-?*", GOTO="mpath_end"
+ 
+ IMPORT{db}="DM_DISABLE_OTHER_RULES_FLAG_OLD"
diff --git a/debian/patches/series b/debian/patches/series
index dc2cd61c..f93c8da1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,4 @@ systemd-alias.patch
 disable-systemd-for-udeb.patch
 disable-rados-link-for-udeb-new.patch
 fix-usrmerge-paths.patch
+11-dm-mpath-fix-DM_UDEV_RULES_VSN-check.patch
-- 
2.15.1

>From fafcb071c66d18d93b19c31203d6b6958de5d477 Mon Sep 17 00:00:00 2001
From: Julian Andres Klode <julian.kl...@canonical.com>
Date: Wed, 10 Jan 2018 13:31:15 +0100
Subject: [PATCH 5/7] d/rules: Run dh_clean from clean target

The clean target should run dh_clean as the last command.
---
 debian/rules | 1 +
 1 file changed, 1 insertion(+)

diff --git a/debian/rules b/debian/rules
index 3cfa67d3..bb5a1f8e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -60,6 +60,7 @@ clean: clean-tree
 	debconf-updatepo
 	rm -rf debian/*.debhelper.log
 	rm -rf debian/tmp-multipath-udeb
+	dh_clean
 
 install-indep:
 	dh_testdir
-- 
2.15.1

>From b31ac99c75e00dbc6263ea8034e3283d80e407e4 Mon Sep 17 00:00:00 2001
From: Julian Andres Klode <julian.kl...@canonical.com>
Date: Wed, 10 Jan 2018 13:48:11 +0100
Subject: [PATCH 6/7] Install 68-del-part-nodes.rules

---
 debian/rules | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/debian/rules b/debian/rules
index bb5a1f8e..21949362 100755
--- a/debian/rules
+++ b/debian/rules
@@ -29,6 +29,7 @@ build-indep:
 build-stamp: clean-tree
 	dh_testdir
 	
+	[ ! -f kpartx/del-part-nodes.rules ] || cp kpartx/dm-parts.rules debian/kpartx.del-part-nodes.udev
 	[ ! -f kpartx/dm-parts.rules ] || cp kpartx/dm-parts.rules debian/kpartx.dm-parts.udev
 	[ ! -f kpartx/kpartx.rules ] || cp kpartx/kpartx.rules debian/kpartx.udev
 	[ ! -f multipath/multipath.rules ] || cp multipath/multipath.rules debian/multipath.udev
@@ -126,6 +127,7 @@ binary-arch: build install
 	dh_installinit -pmultipath-tools
 	dh_installudev -pkpartx
 	dh_installudev -pkpartx --name=dm-parts --priority=56
+	dh_installudev -pkpartx --name=del-part-nodes --priority=68
 	dh_installudev -pmultipath-tools --name=multipath
 	dh_installudev -pmultipath-tools --name=dm-mpath --priority=56
 	dh_link -a lib/systemd/system/multipathd.service \
-- 
2.15.1

>From c964c29fc7ad3e200e7e22ea6599e22f660fd174 Mon Sep 17 00:00:00 2001
From: Julian Andres Klode <julian.kl...@canonical.com>
Date: Mon, 15 Jan 2018 12:12:52 +0100
Subject: [PATCH 7/7] Import upstream commit to fix crash in multipathd

This fixes a crash in multipathd when removing a device that
has already been removed.
---
 ...ools-check-null-path-before-handle-path-f.patch | 48 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 2 files changed, 49 insertions(+)
 create mode 100644 debian/patches/0001-multipath-tools-check-null-path-before-handle-path-f.patch

diff --git a/debian/patches/0001-multipath-tools-check-null-path-before-handle-path-f.patch b/debian/patches/0001-multipath-tools-check-null-path-before-handle-path-f.patch
new file mode 100644
index 00000000..5cd252d9
--- /dev/null
+++ b/debian/patches/0001-multipath-tools-check-null-path-before-handle-path-f.patch
@@ -0,0 +1,48 @@
+From 83924318b419fa2ac25e3eb90a5eb59c9c467666 Mon Sep 17 00:00:00 2001
+From: Guan Junxiong <guanjunxi...@huawei.com>
+Date: Mon, 4 Dec 2017 21:15:50 +0800
+Subject: [PATCH] multipath-tools: check null path before handle path-failed
+ event
+
+In the hot-plug storage OS, if we tear down the target storage,
+there is a race between the path removing from the path list and
+handling the path-failed udev event. Therefore, we need to check
+null path before handle path-failed event.
+
+Signed-off-by: Guan Junxiong <guanjunxi...@huawei.com>
+---
+ multipathd/main.c | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+--- a/multipathd/main.c
++++ b/multipathd/main.c
+@@ -1073,7 +1073,7 @@ uev_pathfail_check(struct uevent *uev, s
+ {
+ 	char *action = NULL, *devt = NULL;
+ 	struct path *pp;
+-	int r;
++	int r = 1;
+ 
+ 	action = uevent_get_dm_action(uev);
+ 	if (!action)
+@@ -1090,15 +1090,17 @@ uev_pathfail_check(struct uevent *uev, s
+ 	lock(&vecs->lock);
+ 	pthread_testcancel();
+ 	pp = find_path_by_devt(vecs->pathvec, devt);
++    if (!pp)
++        goto out_lock;
+ 	r = io_err_stat_handle_pathfail(pp);
+-	lock_cleanup_pop(vecs->lock);
+-
+ 	if (r)
+ 		condlog(3, "io_err_stat: %s: cannot handle pathfail uevent",
+ 				pp->dev);
++out_lock:
++	lock_cleanup_pop(vecs->lock);
+ 	FREE(devt);
+ 	FREE(action);
+-	return 0;
++	return r;
+ out:
+ 	FREE(action);
+ 	return 1;
diff --git a/debian/patches/series b/debian/patches/series
index f93c8da1..de59d07c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -8,3 +8,4 @@ disable-systemd-for-udeb.patch
 disable-rados-link-for-udeb-new.patch
 fix-usrmerge-paths.patch
 11-dm-mpath-fix-DM_UDEV_RULES_VSN-check.patch
+0001-multipath-tools-check-null-path-before-handle-path-f.patch
-- 
2.15.1

Reply via email to