From 5492c62a25313ec645e7330c016e2e406f5205e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 16 Aug 2019 13:20:04 +0200 Subject: [PATCH 1/2] udev: assume all devices which have persistent links also need to be watched We had two similar lists, but one was accepting many more device types. I assume that this is by mistake, simply because the lack of device links is easier to notice than the lack of synthesized event after the device is written to. This uses the same list in both places, effectively adding "watch" attribute to /dev/nbd*, /dev/zd*, etc. --- rules/60-block.rules | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rules/60-block.rules b/rules/60-block.rules index 491081f0b2..a320e63103 100644 --- a/rules/60-block.rules +++ b/rules/60-block.rules @@ -8,4 +8,6 @@ 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*|dasd*|nbd*", OPTIONS+="watch" +ACTION!="remove", SUBSYSTEM=="block", \ + KERNEL=="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|scm*|pmem*|nbd*|zd*", \ + OPTIONS+="watch" From a71eb567886dd7d24f94f65d3cbd8e9651096777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 16 Aug 2019 13:37:14 +0200 Subject: [PATCH 2/2] udev: allow persistent storage rules work for ubi devices Back in dbbf424c8b77c1649e822c20c0b1fee1d2cfd93d, we merged a rule to add persistent storage for /dev/ubi*, but this rule could have never worked because of the top-level exclude. Also set "watch" for /dev/ubi*. --- rules/60-block.rules | 2 +- rules/60-persistent-storage.rules | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rules/60-block.rules b/rules/60-block.rules index a320e63103..3134ab995e 100644 --- a/rules/60-block.rules +++ b/rules/60-block.rules @@ -9,5 +9,5 @@ ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block", # watch metadata changes, caused by tools closing the device node which was opened for writing ACTION!="remove", SUBSYSTEM=="block", \ - KERNEL=="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|scm*|pmem*|nbd*|zd*", \ + KERNEL=="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|ubi*|scm*|pmem*|nbd*|zd*", \ OPTIONS+="watch" diff --git a/rules/60-persistent-storage.rules b/rules/60-persistent-storage.rules index 1d8880ef02..7802b1c94f 100644 --- a/rules/60-persistent-storage.rules +++ b/rules/60-persistent-storage.rules @@ -7,7 +7,7 @@ ACTION=="remove", GOTO="persistent_storage_end" ENV{UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG}=="1", GOTO="persistent_storage_end" SUBSYSTEM!="block", GOTO="persistent_storage_end" -KERNEL!="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|sr*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|scm*|pmem*|nbd*|zd*", GOTO="persistent_storage_end" +KERNEL!="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|sr*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|ubi*|scm*|pmem*|nbd*|zd*", GOTO="persistent_storage_end" # ignore partitions that span the entire disk TEST=="whole_disk", GOTO="persistent_storage_end"