Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp634169rwe; Thu, 25 Aug 2022 06:44:57 -0700 (PDT) X-Google-Smtp-Source: AA6agR6OrvhVOeaq0kNyd0FsTlNkat3WwA+kT4609vvtKeb0uT/pp+cz0pgNz4w9I7tr+u1UV5LE X-Received: by 2002:a17:906:cc13:b0:73d:d22d:63cd with SMTP id ml19-20020a170906cc1300b0073dd22d63cdmr1893471ejb.741.1661435097270; Thu, 25 Aug 2022 06:44:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661435097; cv=none; d=google.com; s=arc-20160816; b=i6RlArY6dePmE5gvbspm7lUHEiBKqVkYBBlHc7tnUrqiX/qY4K8mNqU0ajHWprIzWS MSi8Es2M95B/GuODoDu9XgOYkaXTMjf3XjG7gZa8K//1No1oLN26QUVtEezGe2miU/7w ndzL7LQ9xdavhUbzBhYU8KRqjOwUCkP3I1rvPXVaXL8ohPFi11jdYFOFsc5jUO4BtyBX 8VrgBh5Rsmxpiw3FdsEK/d4JOOWxEsIvga5iZi+MY9mGoZCL2blK/1IrMcAVJ4UX0aJE +d/J1ygT/JloryC+qCxa25rYiF1FCUfenV9Orx4Qo8IQggdfAJETMToZZq22aI3EVsbt 0XjQ== 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:dkim-signature; bh=2azcP9tPZvQFnWr+B5701VWdlvj+WXIa4/SiL59J3Gc=; b=kJcaP/jqHw93eKbEgeP28jQZXQo2tQ48HiBA3A8DxMBd1GU+tcfzdRyUo9ZcLa7IxJ rowTf2bvot3/neBa4LFIWZ0p0vzshb+HDKggmlSY/8exP6TbN6uNJck6zo4GcjE+tA+e TRaW3Qf73iigWfXwlmvkcbE6vqNlWMPkkpJWkzHWtYW2TByLfkzF9ayCDCKhk2ZJV3Q5 uopPr826Lr08dfMZCxUfe5SCu53/BVAUgYYarZRVZAbVaYB7Jv3ltUXvMkzH8zz/eQ0C 0UVbV/kXUZFH+E9A6WPnD+PwmvmmfY43+ukm3WoNLXbC/y1k3eNtpHje/9gK02WT69RN /oKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=JVhxdBDZ; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb11-20020a1709077e8b00b0073d9c29892csi3775671ejc.939.2022.08.25.06.44.31; Thu, 25 Aug 2022 06:44:57 -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; dkim=pass header.i=@suse.com header.s=susede1 header.b=JVhxdBDZ; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231438AbiHYNj1 (ORCPT + 99 others); Thu, 25 Aug 2022 09:39:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235803AbiHYNjZ (ORCPT ); Thu, 25 Aug 2022 09:39:25 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C625B56FD for ; Thu, 25 Aug 2022 06:39:22 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id E53232073D; Thu, 25 Aug 2022 13:39:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1661434760; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2azcP9tPZvQFnWr+B5701VWdlvj+WXIa4/SiL59J3Gc=; b=JVhxdBDZ8ECfBxGpsf1qS6JkalqzAoKaChz7p8wmqF60cq6cDhxExtUodo7EAN5uD7nWux hHez746eEQmgs6aQFkb3+M8Kl2KzB2NW5U3AcvkJE/f8QZC30NtnBcZukrheGc0ExNuAiN JaAt1ksz+1DJ5kNMHt+csMJaJcuG/3Y= Received: from suse.cz (unknown [10.100.201.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 24E082C141; Thu, 25 Aug 2022 13:39:20 +0000 (UTC) Date: Thu, 25 Aug 2022 15:39:19 +0200 From: Petr Mladek To: Jagdish Gediya Cc: Matthew Wilcox , Mark Rutland , Andy Shevchenko , 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, rf@opensource.cirrus.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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Fri 2022-07-29 17:36:50, Andy Shevchenko wrote: > On Fri, Jul 29, 2022 at 05:35:26PM +0300, Andy Shevchenko wrote: > > 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, The problem still seems to be in mainline. > > > That isn't a documented option. > > > > > > rodata= [KNL] > > > on Mark read-only kernel memory as read-only (default). > > > off Leave read-only kernel memory writable for debugging. > > > > > > Hopefully this is an object lesson in why you need to update the > > > documentation when you extend a feature. > > > > > > > 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. > > > As a quick fix, how about only allowing either "f\0" or "fa"? > > > > I think we need to be more strict in kstrtobool(), i.e. 'f\0' ('t\0') and 'fal' > > ('tru') perhaps? > > Actually kstrtobool() has been designed as a generic parser that should have > lowest priority. It means that the code that uses it should take care of any > other custom cases _before_ calling for kstrtobool(). Makes sense. Jagdish, could you please send a patch fixing the "rodata" early_param in arch/arm64/mm/mmu.c? Please, also add: Cc: stable@vger.kernel.org # v5.19+ Best Regards, Petr