From: Krzysztof Mazur <krzysiek@podlesie.net>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: linux-kernel@vger.kernel.org, Pawel Moll <pawel.moll@arm.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] init: fix in-place parameter modification regression
Date: Mon, 14 Oct 2013 11:28:14 +0200 [thread overview]
Message-ID: <20131014092814.GA20882@shrek.podlesie.net> (raw)
In-Reply-To: <87eh7o8ft4.fsf@rustcorp.com.au>
On Mon, Oct 14, 2013 at 06:06:23PM +1030, Rusty Russell wrote:
> Krzysztof Mazur <krzysiek@podlesie.net> writes:
> > Before commit 026cee0086fe1df4cf74691cf273062cc769617d
> > ("params: <level>_initcall-like kernel parameters") the __setup
> > parameter parsing code could modify parameter in the
> > static_command_line buffer and such modifications were kept. After
> > that commit such modifications are destroyed during per-initcall level
> > parameter parsing because the same static_command_line buffer is used
> > and only parameters for appropriate initcall level are parsed.
> >
> > That change broke at least parsing "ubd" parameter in the ubd driver
> > when the COW file is used.
> >
> > Now the separate buffer is used for per-initcall parameter parsing,
> > like in parsing early params.
>
> How about just removing "strcpy(static_command_line, saved_command_line);"
> from do_initcall_level altogether? We already initialize it in
> setup_command_line().
>
That does not work because the command line is always modified -
at least '\0' are added to split strings.
To be sure I tested that with:
diff --git a/kernel/params.c b/kernel/params.c
index c00d5b5..606058a 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -96,6 +96,7 @@ static int parse_one(char *param,
unsigned int i;
int err;
+ printk("param %d-%d: %s\n", min_level, max_level, param);
/* Find parameter */
for (i = 0; i < num_params; i++) {
if (parameq(param, params[i].name)) {
And without that strcpy() I get:
[...]
param 0-0: ubd0
param 1-1: ubd0
[...]
instead of:
[...]
param 0-0: ubd0
param 0-0: ubd1
param 0-0: raid
param 0-0: hostfs
param 0-0: root
param 1-1: ubd0
param 1-1: ubd1
param 1-1: raid
param 1-1: hostfs
param 1-1: root
[...]
I checked that also without udb parameters.
Thanks,
Krzysiek
next prev parent reply other threads:[~2013-10-14 9:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-12 18:05 Krzysztof Mazur
2013-10-14 7:36 ` Rusty Russell
2013-10-14 9:28 ` Krzysztof Mazur [this message]
2013-10-14 11:34 ` Pawel Moll
2013-10-14 12:50 ` Krzysztof Mazur
2013-10-14 13:37 ` Pawel Moll
2013-10-18 3:50 ` Rusty Russell
2013-10-18 9:19 ` Krzysztof Mazur
2013-10-21 1:57 ` Rusty Russell
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=20131014092814.GA20882@shrek.podlesie.net \
--to=krzysiek@podlesie.net \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pawel.moll@arm.com \
--cc=rusty@rustcorp.com.au \
/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
all inboxes | Powered by JetHome®