From 6cfa04faa1beb87f2dd794b7a4df37ce5d1c8407 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 9 Jun 2015 14:46:39 +0200 Subject: [PATCH] fix udev block device watch --- 0005-rules-fix-typo-in-block-watch-rule.patch | 21 +++++++++++++++++++ ...tore-block-watch-after-CHANGE-events.patch | 21 +++++++++++++++++++ systemd.spec | 9 +++++++- 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 0005-rules-fix-typo-in-block-watch-rule.patch create mode 100644 0006-rules-restore-block-watch-after-CHANGE-events.patch diff --git a/0005-rules-fix-typo-in-block-watch-rule.patch b/0005-rules-fix-typo-in-block-watch-rule.patch new file mode 100644 index 0000000..a399782 --- /dev/null +++ b/0005-rules-fix-typo-in-block-watch-rule.patch @@ -0,0 +1,21 @@ +From 10c7cf9e109f6b59159e439774b5be5fd1faa24e Mon Sep 17 00:00:00 2001 +From: Tom Gundersen +Date: Fri, 29 May 2015 19:59:24 +0200 +Subject: [PATCH] rules: fix typo in block watch rule + +The intention was to turn this rule from using a blacklist to a whitelist, but +there was a stray '!'. +--- + rules/60-block.rules | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rules/60-block.rules b/rules/60-block.rules +index de41499..cfd5010 100644 +--- a/rules/60-block.rules ++++ b/rules/60-block.rules +@@ -8,4 +8,4 @@ ACTION=="add", SUBSYSTEM=="module", KERNEL=="block", ATTR{parameters/events_dfl_ + ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block", ATTR{block/*/uevent}="change" + + # watch metadata changes, caused by tools closing the device node which was opened for writing +-ACTION=="add", SUBSYSTEM=="block", KERNEL!="loop*|nvme*|sd*|vd*", OPTIONS+="watch" ++ACTION=="add", SUBSYSTEM=="block", KERNEL=="loop*|nvme*|sd*|vd*", OPTIONS+="watch" diff --git a/0006-rules-restore-block-watch-after-CHANGE-events.patch b/0006-rules-restore-block-watch-after-CHANGE-events.patch new file mode 100644 index 0000000..ce496a0 --- /dev/null +++ b/0006-rules-restore-block-watch-after-CHANGE-events.patch @@ -0,0 +1,21 @@ +From 7a41b5a87167c3628d702d5f9db0cba1df4eff2c Mon Sep 17 00:00:00 2001 +From: Tom Gundersen +Date: Fri, 29 May 2015 20:55:39 +0200 +Subject: [PATCH] rules: restore block watch after CHANGE events + +When processing an event, the watch is disabled, make sure it is restorted after +a CHANGE event has been processed. +--- + rules/60-block.rules | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rules/60-block.rules b/rules/60-block.rules +index cfd5010..a69d648 100644 +--- a/rules/60-block.rules ++++ b/rules/60-block.rules +@@ -8,4 +8,4 @@ ACTION=="add", SUBSYSTEM=="module", KERNEL=="block", ATTR{parameters/events_dfl_ + ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block", ATTR{block/*/uevent}="change" + + # watch metadata changes, caused by tools closing the device node which was opened for writing +-ACTION=="add", SUBSYSTEM=="block", KERNEL=="loop*|nvme*|sd*|vd*", OPTIONS+="watch" ++ACTION!="remove", SUBSYSTEM=="block", KERNEL=="loop*|nvme*|sd*|vd*", OPTIONS+="watch" diff --git a/systemd.spec b/systemd.spec index e317a68..8e0b11b 100644 --- a/systemd.spec +++ b/systemd.spec @@ -16,7 +16,7 @@ Name: systemd Url: http://www.freedesktop.org/wiki/Software/systemd Version: 220 -Release: 6%{?gitcommit:.git%{gitcommit}}%{?dist} +Release: 7%{?gitcommit:.git%{gitcommit}}%{?dist} # For a breakdown of the licensing, see README License: LGPLv2+ and MIT and GPLv2+ Summary: A System and Service Manager @@ -56,6 +56,10 @@ Patch1002: 0001-udevd-fix-SIGCHLD-handling-in-daemon-mode.patch # Add support for petera disk encryption Patch1003: 0004-cryptsetup-craft-a-unique-ID-with-the-source-device.patch +# Fix udev block device watch +Patch1004: 0005-rules-fix-typo-in-block-watch-rule.patch +Patch1005: 0006-rules-restore-block-watch-after-CHANGE-events.patch + %global num_patches %{lua: c=0; for i,p in ipairs(patches) do c=c+1; end; print(c);} BuildRequires: libcap-devel @@ -863,6 +867,9 @@ getent passwd systemd-journal-upload >/dev/null 2>&1 || useradd -r -l -g systemd /usr/lib/firewalld/services/* %changelog +* Tue Jun 09 2015 Harald Hoyer 220-7 +- fix udev block device watch + * Tue Jun 09 2015 Harald Hoyer 220-6 - add support for network disk encryption