From: Greg KH <gregkh@linuxfoundation.org>
To: Jessica Yu <jeyu@kernel.org>
Cc: linux-kernel@vger.kernel.org,
systemd-devel@lists.freedesktop.org, Franck Bui <fbui@suse.com>,
Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
Subject: Re: [systemd-devel] [PATCH RFC 1/1] module: delay kobject uevent until after module init call
Date: Thu, 3 Dec 2020 19:32:19 +0100 [thread overview]
Message-ID: <X8kvM8hl6abbfg8W@kroah.com> (raw)
In-Reply-To: <20201203135124.16695-2-jeyu@kernel.org>
On Thu, Dec 03, 2020 at 02:51:24PM +0100, Jessica Yu wrote:
> Apparently there has been a longstanding race between udev/systemd and
> the module loader. Currently, the module loader sends a uevent right
> after sysfs initialization, but before the module calls its init
> function. However, some udev rules expect that the module has
> initialized already upon receiving the uevent.
>
> This race has been triggered recently (see link in references) in some
> systemd mount unit files. For instance, the configfs module creates the
> /sys/kernel/config mount point in its init function, however the module
> loader issues the uevent before this happens. sys-kernel-config.mount
> expects to be able to mount /sys/kernel/config upon receipt of the
> module loading uevent, but if the configfs module has not called its
> init function yet, then this directory will not exist and the mount unit
> fails. A similar situation exists for sys-fs-fuse-connections.mount, as
> the fuse sysfs mount point is created during the fuse module's init
> function. If udev is faster than module initialization then the mount
> unit would fail in a similar fashion.
>
> To fix this race, delay the module KOBJ_ADD uevent until after the
> module has finished calling its init routine.
>
> References: https://github.com/systemd/systemd/issues/17586
> Signed-off-by: Jessica Yu <jeyu@kernel.org>
Nice fix:
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
next prev parent reply other threads:[~2020-12-03 18:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-03 13:51 [PATCH RFC 0/1] Delay module uevent until after initialization Jessica Yu
2020-12-03 13:51 ` [PATCH RFC 1/1] module: delay kobject uevent until after module init call Jessica Yu
2020-12-03 14:42 ` Nicolas Morey-Chaisemartin
2020-12-03 18:32 ` Greg KH [this message]
2020-12-10 12:39 ` Jessica Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=X8kvM8hl6abbfg8W@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=fbui@suse.com \
--cc=jeyu@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nmoreychaisemartin@suse.com \
--cc=systemd-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox