Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4749100pxu; Thu, 10 Dec 2020 04:42:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJykSJqhhmzydNydsMGQVDw6qK4GVG/3RRxdIHMNOJ9WM0NLbSlcqlA36XN71Kk1wkMVN7v3 X-Received: by 2002:a17:906:447:: with SMTP id e7mr6173462eja.172.1607604136749; Thu, 10 Dec 2020 04:42:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607604136; cv=none; d=google.com; s=arc-20160816; b=IieJ9qzQXTZck4UlQ/I//8isFEmlo5Q5Bffk9ZN0s74uKSKuAzNv7PUXckCJOMYcIE Gmxzhy4L1c0m8zSM1ysWjtuaoXEwOp6tx5mFQ8if1/vWI1GwDkTN4Xb2L8ZDMx6eV6yP mO06VggsAqRDr3hc4ZCmrPZlfgXGC88YG9/8HdboWwZ8CvacLhiYUHrrlQptWljL51az Lh6yBWNUJ3qTam0fdQYvFljBiwZTM79ZWXcKvJnpK+FIXcocjNxH+qsqtsjbbFb6K1s8 IlemTQ+Ge9Sijszs8bMoTYpnVzv88Bh0E456wJ9kRxHkdygOUFZ3m9MVzy2bfv/hUf52 K89Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from :dkim-signature:date; bh=R9vT9hSkc8LlAqDMjrVSGcwbTBiWyWa5JZCctWQYf1w=; b=Vn8K7cJrzozZuaWsST/wuEzWOQTQVhH22gGO+HJhIA6rJrDIC09Sc/zbuIEvxAYCQB Jxu7Fp8GuO7aUsaEUK0TBfBhUzWVxCJa4f1xizMM7rkkWLDkX1hK8hr5OPg2D7dfOHI2 fT3ywutZSnlw6a5RCdOyysT7ezFBlMwUJcjB02cC6ozPJVFVG2TlH4h8++A6FvYHYJBK BqqaqCEQcIktYiJjetjdbE83EITkapb60B5Hshz7YHcR92p398MaqQIKnINXbb5mlWqz IlB37pWp/Uzr3ItdVkoVGb21bIUZStvKAnTgBslkV3lWSRfd1Gpnd1+JV67PdBD5ednm zOXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EKmPXu5l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h2si2328093ejb.710.2020.12.10.04.41.54; Thu, 10 Dec 2020 04:42:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EKmPXu5l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727277AbgLJMjq (ORCPT + 99 others); Thu, 10 Dec 2020 07:39:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:39118 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725947AbgLJMjq (ORCPT ); Thu, 10 Dec 2020 07:39:46 -0500 Date: Thu, 10 Dec 2020 13:39:00 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1607603946; bh=R9vT9hSkc8LlAqDMjrVSGcwbTBiWyWa5JZCctWQYf1w=; h=From:To:Cc:Subject:References:In-Reply-To:From; b=EKmPXu5lyubf303FVqVLcnV5tIyyw2CcBliYXxaHfvniGSPohah2U7LmT4lR1j7+6 Xw6FrdBsmvay5T0wsIoswzIdhAniI7Ah0DRTd4iDak/1R4eIaaDeeieTU7uRKQ0CeL zaM0W6yL4z73NAUXn4SCl0Jx8S9jJdeIOBJGJ7PlfNO7i37jDCyz+3fNOFvU02vuYT dv9N6pB79bT1FeEOwBDVIQyipItOn5VJCyjLVlafEQIQMiV1MVGuzY3qtLU5dylycq NQQ8us7sh91Dt8gGr8KLG/BYn99WcrdlYDOmgMUxdYsDaoZzV5NYYluG11yVfp3Li+ fqGm25RXE1s+Q== From: Jessica Yu To: linux-kernel@vger.kernel.org, systemd-devel@lists.freedesktop.org Cc: Nicolas Morey-Chaisemartin , Franck Bui Subject: Re: [PATCH RFC 1/1] module: delay kobject uevent until after module init call Message-ID: <20201210123900.GA28117@linux-8ccs> References: <20201203135124.16695-1-jeyu@kernel.org> <20201203135124.16695-2-jeyu@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20201203135124.16695-2-jeyu@kernel.org> X-OS: Linux linux-8ccs 4.12.14-lp150.12.61-default x86_64 User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +++ Jessica Yu [03/12/20 14:51 +0100]: >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 Thanks all, this has been applied to modules-next to try to get as much -next time as possible before the upcoming merge window. Jessica