From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2790FC433EF for ; Mon, 25 Jul 2022 15:36:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4D6728E0002; Mon, 25 Jul 2022 11:36:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4855B8E0001; Mon, 25 Jul 2022 11:36:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 375078E0002; Mon, 25 Jul 2022 11:36:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 2A5748E0001 for ; Mon, 25 Jul 2022 11:36:43 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 05807804B0 for ; Mon, 25 Jul 2022 15:36:43 +0000 (UTC) X-FDA: 79726024686.24.C08A60C Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf17.hostedemail.com (Postfix) with ESMTP id 8D0E1400B5 for ; Mon, 25 Jul 2022 15:36:41 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 34C5A2B; Mon, 25 Jul 2022 08:36:41 -0700 (PDT) Received: from FVFF77S0Q05N.cambridge.arm.com (FVFF77S0Q05N.cambridge.arm.com [10.1.28.151]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E1E5B3F73D; Mon, 25 Jul 2022 08:36:38 -0700 (PDT) Date: Mon, 25 Jul 2022 16:36:33 +0100 From: Mark Rutland To: Matthew Wilcox Cc: Jagdish Gediya , 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() Message-ID: References: <20220426180203.70782-1-jvgediya@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658763402; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=L92x03ck2FUDz9bQ+q69j8/aAZiM6aaCOiUSdhwJSP4=; b=eWfuXV0WGEJMEp8dSq+cFPRdua+CVWTbJzGdBZL/pn5lg+YfgFovm+oqhkxZTSrjF8xxrX EAk1ImWkTRtJZR+XXmi3M1SKsmwYJuPvgHIZOyijh7Uzd1W9+jiDlUk4dprexdB9Ojkxp0 48s+X1FK/GOptIxTyDVRYTALIbEJmHY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658763402; a=rsa-sha256; cv=none; b=sNLYSnLnMC+HNb+qVnRRMBZ96OQkn4zl8/z0XGy7CY5Og+9FiRYToDj/WU778v8cH6+701 FNvzS4LVTMjsWbzCfHLR2Sm92b/sc60DLCcMh1+moTpx+fmShjWRi58lqmRHDKjcjqFpIo 5sWjMhivvvp8CPRIMSG5GW8HTUn2KDg= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf17.hostedemail.com: domain of mark.rutland@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=mark.rutland@arm.com Authentication-Results: imf17.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf17.hostedemail.com: domain of mark.rutland@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=mark.rutland@arm.com X-Stat-Signature: 3agz35skf4m6h5do6fp1fipqeid3144c X-Rspamd-Queue-Id: 8D0E1400B5 X-Rspam-User: X-Rspamd-Server: rspam06 X-HE-Tag: 1658763401-439477 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 > > > Reviewed-by: Matthew Wilcox (Oracle) > > > > 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.