From c0df31a593ce94b66100b5d4a64b38568494d56e Mon Sep 17 00:00:00 2001 From: Hongxu Jia Date: Fri, 17 Nov 2017 01:08:03 -0500 Subject: systemd: fix formatting IDE storage does not trigger "change" uevents Formatting IDE storage does not trigger "change" uevents. As a result clients using udev API don't get any updates afterwards and get outdated information about the device. ... root@qemux86-64:~# mkfs.ext4 -F /dev/hda1 Creating filesystem with 262144 4k blocks and 65536 inodes Filesystem UUID: 98791eb2-2bf3-47ad-b4d8-4cf7e914eee2 root@qemux86-64:~# ls /dev/disk/by-uuid/98791eb2-2bf3-47ad-b4d8-4cf7e914eee2 ls: cannot access '/dev/disk/by-uuid/98791eb2-2bf3-47ad-b4d8-4cf7e914eee2': No such file or directory ... Include hd* in a match for watch option assignment. Signed-off-by: Hongxu Jia Signed-off-by: Ross Burton --- ...les-watch-metadata-changes-in-ide-devices.patch | 43 ++++++++++++++++++++++ meta/recipes-core/systemd/systemd_234.bb | 1 + 2 files changed, 44 insertions(+) create mode 100644 meta/recipes-core/systemd/systemd/0020-rules-watch-metadata-changes-in-ide-devices.patch (limited to 'meta/recipes-core/systemd') diff --git a/meta/recipes-core/systemd/systemd/0020-rules-watch-metadata-changes-in-ide-devices.patch b/meta/recipes-core/systemd/systemd/0020-rules-watch-metadata-changes-in-ide-devices.patch new file mode 100644 index 0000000000..17d698a06c --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0020-rules-watch-metadata-changes-in-ide-devices.patch @@ -0,0 +1,43 @@ +From 8207d645582e96c56950674e104653d0cd552d60 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia +Date: Fri, 17 Nov 2017 09:46:00 +0800 +Subject: [PATCH] rules: watch metadata changes in ide devices + +Formatting IDE storage does not trigger "change" uevents. As a result +clients using udev API don't get any updates afterwards and get outdated +information about the device. +... +root@qemux86-64:~# mkfs.ext4 -F /dev/hda1 +Creating filesystem with 262144 4k blocks and 65536 inodes +Filesystem UUID: 98791eb2-2bf3-47ad-b4d8-4cf7e914eee2 + +root@qemux86-64:~# ls /dev/disk/by-uuid/98791eb2-2bf3-47ad-b4d8-4cf7e914eee2 +ls: cannot access '/dev/disk/by-uuid/98791eb2-2bf3-47ad-b4d8-4cf7e914eee2': No such file or directory +... +Include hd* in a match for watch option assignment. + +Upstream-Status: Denied + +qemu by default emulates IDE and the linux-yocto kernel(s) use +CONFIG_IDE instead of the more modern libsata, so disks appear as +/dev/hd*. A similar patch rejected by upstream because CONFIG_IDE +is deprecated. + +Signed-off-by: Hongxu Jia +--- + 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 343fc06..b5237da 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!="remove", SUBSYSTEM=="block", KERNEL=="loop*|nvme*|sd*|vd*|xvd*|pmem*|mmcblk*", OPTIONS+="watch" ++ACTION!="remove", SUBSYSTEM=="block", KERNEL=="loop*|nvme*|sd*|vd*|xvd*|pmem*|mmcblk*|hd*", OPTIONS+="watch" +-- +1.8.3.1 + diff --git a/meta/recipes-core/systemd/systemd_234.bb b/meta/recipes-core/systemd/systemd_234.bb index bfcecb3d4e..765daf2084 100644 --- a/meta/recipes-core/systemd/systemd_234.bb +++ b/meta/recipes-core/systemd/systemd_234.bb @@ -27,6 +27,7 @@ SRC_URI = "git://github.com/systemd/systemd.git;protocol=git \ file://0017-remove-duplicate-include-uchar.h.patch \ file://0018-check-for-uchar.h-in-configure.patch \ file://0019-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch \ + file://0020-rules-watch-metadata-changes-in-ide-devices.patch \ file://0001-add-fallback-parse_printf_format-implementation.patch \ file://0002-src-basic-missing.h-check-for-missing-strndupa.patch \ file://0003-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch \ -- cgit 1.2.3-korg