[Bug 1220303] New: KMP installation fails to make device node
https://bugzilla.suse.com/show_bug.cgi?id=1220303 Bug ID: 1220303 Summary: KMP installation fails to make device node Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: x86-64 OS: Linux Status: NEW Severity: Normal Priority: P5 - None Component: Kernel Assignee: kernel-bugs@opensuse.org Reporter: jengelh@inai.de QA Contact: qa-bugs@suse.de Target Milestone: --- Found By: --- Blocker: --- After installing a KMP such as vhba-kmp-default.rpm, no device node /dev/vhba_ctl shows up until the system is rebooted. As such, the device cannot be opened without loading the module manually (and thus triggering an udev event to produce the device node belatedly). == Observed behavior == # zypper in vhba-kmp-default Loading repository data... Reading installed packages... Resolving package dependencies... The following NEW package is going to be installed: vhba-kmp-default 1 new package to install. Overall download size: 27.1 KiB. Already cached: 0 B. After the operation, additional 57.7 KiB will be used. Continue? [y/n/v/...? shows all options] (y): Retrieving: vhba-kmp-default-20240202_k6.7.5_1-1.2.x86_64 (base) (1/1), 27.1 KiB Retrieving: vhba-kmp-default-20240202_k6.7.5_1-1.2.x86_64.rpm ............[done] Verifying ................................................................[done] Preparing ................................................................[done] (0/1) Executing prein script for: vhba-kmp-default-20240202_k6.7.5_1-1.2.x[done] (1/1) Installing: vhba-kmp-default-20240202_k6.7.5_1-1.2.x86_64 ..........[done] (1/1) Executing postin script for: vhba-kmp-default-20240202_k6.7.5_1-1.2.[done] (1/1) Executing posttrans script for: vhba-kmp-default-20240202_k6.7.5_1-1[done] # ls -l /dev/vhb* ls: cannot access '/dev/vhb*': No such file or directory == Expected behavior == Create the device node right away. # ls -l /dev/vhb* crw------- 1 root root 10, 170 Feb 25 14:31 /dev/vhba_ctl == Possible implementation == Adjust the KMP %post scriptlet so that it executes: systemctl restart kmod-static-nodes.service systemd-tmpfiles-setup-dev.service -- You are receiving this mail because: You are the assignee for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1220303
https://bugzilla.suse.com/show_bug.cgi?id=1220303#c1
Martin Wilck
https://bugzilla.suse.com/show_bug.cgi?id=1220303
https://bugzilla.suse.com/show_bug.cgi?id=1220303#c2
Jan Engelhardt
Why do you expect that after installing the package, the module is automatically loaded?
That is *not* what I wrote in the "Expected behavior" section. -- You are receiving this mail because: You are the assignee for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1220303
https://bugzilla.suse.com/show_bug.cgi?id=1220303#c3
Martin Wilck
https://bugzilla.suse.com/show_bug.cgi?id=1220303
https://bugzilla.suse.com/show_bug.cgi?id=1220303#c4
Martin Wilck
https://bugzilla.suse.com/show_bug.cgi?id=1220303
https://bugzilla.suse.com/show_bug.cgi?id=1220303#c5
Jan Engelhardt
I don't think that there is a safe way to remove such nodes on KMP removal.
The kernel module stays loaded even if you remove the KMP; therefore the node should stay too. Moreover, some kernel modules may not be rmmodable right now due to being in use.
tmpfiles.d(5), which recommends doing [the exclamation thing] for static device nodes
I can't find a direct wording in tmpfiles.d(5) for c! specifically (just r! and ! in general). kmod commit 27eceb2e4ecbf2e31940b67cee682a6935f61e6c has some helpful remarks: >creating static nodes later on will likely not >behave as expected. In particular, recreating >the static nodes at run-time will reset any >permissions udev may have applied to the nodes >at boot. However, this problem is caused by kmod's own code: ret = fprintf(out, "%c! /dev/%s 0600 - - - %u:%u\n", It kmod had specified "-" rather than "0600", there would be no mode change of an existing device node. On the other hand, a "-" causes systemd-tmpfiles to perform the initial creation with 0644. Why can't we have nice things 🙄 -- You are receiving this mail because: You are the assignee for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1220303
https://bugzilla.suse.com/show_bug.cgi?id=1220303#c6
Martin Wilck
I don't think that there is a safe way to remove such nodes on KMP removal.
The kernel module stays loaded even if you remove the KMP; therefore the node should stay too. Moreover, some kernel modules may not be rmmodable right now due to being in use.
Right. But the device node stays in place even if the module had never been loaded.
I can't find a direct wording in tmpfiles.d(5) for c! specifically (just r! and ! in general).
"c, c+ [...] It is recommended to suffix this entry with an exclamation mark to only create static device nodes at boot, as udev will not manage static device nodes that are created at runtime." It comes down to basically the same thing as your quote below.
kmod commit 27eceb2e4ecbf2e31940b67cee682a6935f61e6c has some helpful remarks:
>creating static nodes later on will likely not >behave as expected. In particular, recreating >the static nodes at run-time will reset any >permissions udev may have applied to the nodes >at boot.
I suppose that we won't do much harm by creating new static nodes when KMPs are added. Unfortunately "systemctl restart kmod-static-nodes.service systemd-tmpfiles-setup-dev.service" will also re-create all previously existing nodes, which may actually be harmful. Michal, what's your take on this? -- You are receiving this mail because: You are the assignee for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1220303
https://bugzilla.suse.com/show_bug.cgi?id=1220303#c7
Michal Suchanek
https://bugzilla.suse.com/show_bug.cgi?id=1220303
https://bugzilla.suse.com/show_bug.cgi?id=1220303#c8
--- Comment #8 from Takashi Iwai
https://bugzilla.suse.com/show_bug.cgi?id=1220303
https://bugzilla.suse.com/show_bug.cgi?id=1220303#c9
--- Comment #9 from Jan Engelhardt
https://bugzilla.suse.com/show_bug.cgi?id=1220303
https://bugzilla.suse.com/show_bug.cgi?id=1220303#c10
--- Comment #10 from Martin Wilck
https://bugzilla.suse.com/show_bug.cgi?id=1220303
https://bugzilla.suse.com/show_bug.cgi?id=1220303#c11
Martin Wilck
participants (1)
-
bugzilla_noreply@suse.com