From: Mark Rutland <mark.rutland@arm.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Jagdish Gediya <jvgediya@linux.ibm.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
ying.huang@intel.com, dave.hansen@intel.com,
Jonathan.Cameron@huawei.com, adobriyan@gmail.com,
akpm@linux-foundation.org, andriy.shevchenko@linux.intel.com,
rf@opensource.cirrus.com, pmladek@suse.com, will@kernel.org
Subject: Re: [PATCH v3 1/2] lib/kstrtox.c: Add "false"/"true" support to kstrtobool()
Date: Mon, 25 Jul 2022 16:36:33 +0100 [thread overview]
Message-ID: <Yt64gbsRWY3RIPOy@FVFF77S0Q05N.cambridge.arm.com> (raw)
In-Reply-To: <Yt605xj898VSAsA3@casper.infradead.org>
On Mon, Jul 25, 2022 at 04:21:11PM +0100, Matthew Wilcox wrote:
> On Mon, Jul 25, 2022 at 03:55:27PM +0100, Mark Rutland wrote:
> > On Tue, Apr 26, 2022 at 11:32:02PM +0530, Jagdish Gediya wrote:
> > > At many places in kernel, It is necessary to convert sysfs input
> > > to corrosponding bool value e.g. "false" or "0" need to be converted
> > > to bool false, "true" or "1" need to be converted to bool true,
> > > places where such conversion is needed currently check the input
> > > string manually, kstrtobool() can be utilized at such places but
> > > currently it doesn't have support to accept "false"/"true".
> > >
> > > Add support to accept "false"/"true" as valid string in kstrtobool().
> > >
> > > Signed-off-by: Jagdish Gediya <jvgediya@linux.ibm.com>
> > > Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> >
> > I've just spotted that this broke arm64's "rodata=full" command line option,
> > since "full" gets parsed as 'f' = FALSE, when previously that would have been
> > rejected. So anyone passing "rodata=full" on the command line will have rodata
> > disabled, which is not what they wanted.
> >
> > The current state of things is a bit messy (we prase the option twice because
> > arch code needs it early), and we can probably fix that with some refactoring,
> > but I do wonder if we actually want to open up the sysfs parsing to accept
> > anything *beginning* with [tTfF] rather than the full "true" and "false"
> > strings as previously, or whether it's worth reverting this for now in case
> > anything else is affected.
>
> Well, that's going to break people who've started using the new option.
Ah; I had mistakenly thought this was new in v5.19, and so a revert was fine. I
see that it made it in for v5.18.
> As a quick fix, how about only allowing either "f\0" or "fa"?
TBH I reckon it's best to go for reworking the "rodata=" parsing, and
backporting that to stable, since people could be relying on any "f*" string by
now...
I'll have a go at that rework...
Mark.
next prev parent reply other threads:[~2022-07-25 15:36 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-26 18:02 [PATCH v3 1/2] lib/kstrtox.c: Add "false"/"true" support to kstrtobool() Jagdish Gediya
2022-04-26 18:02 ` [PATCH v3 2/2] mm: Convert sysfs input to bool using kstrtobool() Jagdish Gediya
2022-04-26 19:14 ` [PATCH v3 1/2] lib/kstrtox.c: Add "false"/"true" support to kstrtobool() Matthew Wilcox
2022-04-26 20:40 ` David Laight
2022-04-27 10:21 ` Jagdish Gediya
2022-04-27 15:13 ` Andy Shevchenko
2022-04-27 17:39 ` Andrew Morton
2022-04-27 18:17 ` Andy Shevchenko
2022-04-27 18:19 ` Andy Shevchenko
2022-07-25 14:55 ` Mark Rutland
2022-07-25 15:21 ` Matthew Wilcox
2022-07-25 15:36 ` Mark Rutland [this message]
2022-07-29 14:35 ` Andy Shevchenko
2022-07-29 14:36 ` Andy Shevchenko
2022-08-25 13:39 ` Petr Mladek
2022-08-26 10:35 ` Will Deacon
2022-07-29 15:17 ` Alexey Dobriyan
2022-07-29 15:32 ` Andy Shevchenko
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=Yt64gbsRWY3RIPOy@FVFF77S0Q05N.cambridge.arm.com \
--to=mark.rutland@arm.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=dave.hansen@intel.com \
--cc=jvgediya@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=pmladek@suse.com \
--cc=rf@opensource.cirrus.com \
--cc=will@kernel.org \
--cc=willy@infradead.org \
--cc=ying.huang@intel.com \
/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;
as well as URLs for NNTP newsgroup(s).