Skip to content

Commit 85ee15a

Browse files
jiayi0118keszybz
authored andcommitted
rules: go to the end of rules indeed when dm is suspended
The previous patch 466266c does not make sense indeed, that is to say, if the SYSTEMD_READY is not recorded in the database, the GOTO="systemd_end" will not be applied. The IMPORT{db} is actually a matching token, it returns false when there is no SYSTEMD_READY recorded in the database. The previous patch 466266c tended to inherit the state of SYSTEMD_READY from the database and skip to the end of current rule file. But when the database does not contain SYSTEMD_READY, e.g., the dm-* is not set db_persistent during initrd and the database will be cleared after switching root, the following rules will still be applied not as expected. (cherry picked from commit c1a2ada) (cherry picked from commit 7237dfc)
1 parent 4d2c65e commit 85ee15a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

rules.d/99-systemd.rules.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ SUBSYSTEM=="ubi", TAG+="systemd"
1919
SUBSYSTEM=="block", TAG+="systemd"
2020

2121
# We can't make any conclusions about suspended DM devices so let's just import previous SYSTEMD_READY state and skip other rules
22-
SUBSYSTEM=="block", ENV{DM_SUSPENDED}=="1", IMPORT{db}="SYSTEMD_READY", GOTO="systemd_end"
22+
SUBSYSTEM=="block", ENV{DM_SUSPENDED}=="1", IMPORT{db}="SYSTEMD_READY"
23+
SUBSYSTEM=="block", ENV{DM_SUSPENDED}=="1", GOTO="systemd_end"
24+
2325
SUBSYSTEM=="block", ACTION=="add", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", ENV{SYSTEMD_READY}="0"
2426

2527
# Ignore encrypted devices with no identified superblock on it, since

test/fuzz/fuzz-udev-rules/99-systemd.rules

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ SUBSYSTEM=="ubi", TAG+="systemd"
1717
SUBSYSTEM=="block", TAG+="systemd"
1818

1919
# We can't make any conclusions about suspended DM devices so let's just import previous SYSTEMD_READY state and skip other rules
20-
SUBSYSTEM=="block", ENV{DM_SUSPENDED}=="1", IMPORT{db}="SYSTEMD_READY", GOTO="systemd_end"
20+
SUBSYSTEM=="block", ENV{DM_SUSPENDED}=="1", IMPORT{db}="SYSTEMD_READY"
21+
SUBSYSTEM=="block", ENV{DM_SUSPENDED}=="1", GOTO="systemd_end"
22+
2123
SUBSYSTEM=="block", ACTION=="add", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", ENV{SYSTEMD_READY}="0"
2224

2325
# Ignore encrypted devices with no identified superblock on it, since

0 commit comments

Comments
 (0)