Received: by 2002:a05:6830:16d2:b0:61c:ac69:ca1b with SMTP id l18csp2157713otr; Mon, 25 Jul 2022 08:40:45 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tcQlng4RD53T8OEwK+xGTnCQf74CD9okQVoMu8KxIMXxg4X1Zq/zdoZq7XPKFwE2V+dgDp X-Received: by 2002:a05:6a02:11b:b0:40d:dfdc:95d7 with SMTP id bg27-20020a056a02011b00b0040ddfdc95d7mr11643354pgb.536.1658763645203; Mon, 25 Jul 2022 08:40:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658763645; cv=none; d=google.com; s=arc-20160816; b=kNaTwctzlQ8QnRnaOA2tFB+b5jwfEml2vZO7xZ0uZVts+q9zGBtismzqoQ3ghcTXlh L1rWeNawjIVjrrCq0m8uGZ9B2RFf4xlAjSOIB6u98AXvjuCTKkh2GWi6DtONgdVQdDe+ 9CpgopVTx17qliFN8tJfjuRbx+mX3rbqzY2V5qtj7puT3jMPlE3qc/XRNZHPDRB8TUPt vCGtTuTkvTulihBdfRuOafTVZPjs8tNgUSoNYuVQDt1cMO1Xg5mIcIY7TTGdT3atRlHd hTeZLp2eAnlWLKy5VfhOSS2fzU+jQ65l8GAOA+OqHcIpujo7eYXDiu8kK8+2vYriZjcW p2XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=L92x03ck2FUDz9bQ+q69j8/aAZiM6aaCOiUSdhwJSP4=; b=mY3ra9CNb1sY/wg/1dplB5mvTNbhScpW+C9lIihW2h9T807eSJMurzB5BI3y/DBEW7 53qlONQKM0YgWl2QGPGwB6xd3S2C8DIEjnwoQ64nmonkzDj026Tn4ht3A0JOvYHI1Y9U fVu7opubWfF22lRFscr2lNxowFSsOjdnsy+Etr+725sGOAKqrizHlYpjzsKD20xDGtLT LmnbH4KVelESpKE5QuzVR0n0eAizx58awGnDKLt7pMmLXmcTfjEp60blHXUE8wtBwl5F 87BWheUlN4GhP255xE4jxQAEAHnIF5wcQmrOnuf48g8Jtp3bmQt9GFfIqtHaATjSS/Wd iTbA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q21-20020a056a00085500b0052ab37ed70asi17758780pfk.57.2022.07.25.08.40.28; Mon, 25 Jul 2022 08:40:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235175AbiGYPgo (ORCPT + 99 others); Mon, 25 Jul 2022 11:36:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232199AbiGYPgm (ORCPT ); Mon, 25 Jul 2022 11:36:42 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D879ABC98 for ; Mon, 25 Jul 2022 08:36:40 -0700 (PDT) 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: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 > > > 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.