All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mariusz Tkaczyk <mtkaczyk@kernel.org>
To: Coly Li <colyli@suse.de>
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH v3]  mdopen: add sbin path to env PATH when call system("modprobe md_mod")
Date: Mon, 27 Jan 2025 10:14:17 +0100	[thread overview]
Message-ID: <20250127101344.215b2aff@mtkaczyk-private-dev> (raw)
In-Reply-To: <20250122151859.254365-1-colyli@suse.de>

On Wed, 22 Jan 2025 23:18:59 +0800
Coly Li <colyli@suse.de> wrote:

> During the boot process if mdadm is called in udev context, sbin paths
> like /sbin, /usr/sbin, /usr/local/sbin normally not defined in PATH
> env variable, calling system("modprobe md_mod") in
> create_named_array() may fail with 'sh: modprobe: command not found'
> error message.
> 
> We don't want to move modprobe binary into udev private directory, so
> setting the PATH env is a more proper method to avoid the above issue.
> 
> This patch sets PATH env variable with
> "/sbin:/usr/sbin:/usr/local/sbin" before calling system("modprobe
> md_mod"). The change only takes effect within the udev worker
> context, not seen by global udev environment.
> 
> Signed-off-by: Coly Li <colyli@suse.de>
> ---
> Changelog,
> v3, check return value of getenv().
> v2: set buf[PATH_MAX] to 0 in stack variable announcement.
> v1: the original version.
> 

Applied!
Thanks,
Mariusz

      reply	other threads:[~2025-01-27  9:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-22 15:18 [PATCH v3] mdopen: add sbin path to env PATH when call system("modprobe md_mod") Coly Li
2025-01-27  9:14 ` Mariusz Tkaczyk [this message]

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=20250127101344.215b2aff@mtkaczyk-private-dev \
    --to=mtkaczyk@kernel.org \
    --cc=colyli@suse.de \
    --cc=linux-raid@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.