Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp1679981rdb; Sun, 19 Nov 2023 06:13:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IGsqmqnjFFImKUVCTgkYPIK194ak3JRE0y++ZMPgX0OjNk4lVlT8BUE+6ZI4ljUxGf8e4TT X-Received: by 2002:a05:6808:1701:b0:3ae:251b:5552 with SMTP id bc1-20020a056808170100b003ae251b5552mr7801972oib.12.1700403226122; Sun, 19 Nov 2023 06:13:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700403226; cv=none; d=google.com; s=arc-20160816; b=hQVmRYJW8oQa0l0sFAVwiISqFdAJIlTKmsiaG0cfwCN6/Hk/icikvzHccGJG5c1Kni 0j54nOMNmGGxpLSHp1YzhfRowlQB2huylsY1QxGDZhY39z8K3TXs9GI6Pi0wteE5EtSq 3xyk/chxKtWLdmGzxadxrTMaX4+rR48HUpMhtECndDf63wIbYTUNsd0sndwuhLdIcsmc xa1DrBQc46LH7mNGRfhsypcHrgz9tpzfQk8xCfQIaeiqtrova4cX6zlzu/rp7nFEUisb QLq8PyPBIh3HRYQloB6WfdAIh7ODNVuMTzYyk7BAZM/IkpQOJbe3nGmMYPnHhWswt0j/ EgeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=t6/LH3DJPxANC0T8RNJ8m5HT/bXXnVCsCpC3L0JD3e0=; fh=ESHo9frQONDf1IuKh0rIH4BQ/oSCksHSrrzGLi44mFo=; b=gJWiZfRkGutGQBLod86NoMta5n1HDYXd2S0clP+bslKXy7INN/MrUAcrDCfD6HoYQm Gke74Apv5p+TPgr4IHdxyj7LzxVbzPwh4SJpE7Ypc3a5vkFFIMmQbJa3OxjrVEP8cnlj PHUWW5RNrv5QtS6cykYkZt1zM4hF+BAy5nln9Os/i7cz6YGglDrmSxC3JJHHCUKcB7gc pICr+IUV3l53nn2ely8QmuLyULwSL7Fr2IvHoXfLZX294wpJjcAL8O8GYDKYxQSD2IK0 3VmwZFR7HfdSDgaAErzl0kort0bFBsEuDRlj/SEInd9V4DPB44RwszK5Mk6Ai8Q9nzs1 g7tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=DlYKwozc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id h20-20020a63c014000000b005c1e7583b8csi6363396pgg.96.2023.11.19.06.13.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 06:13:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=DlYKwozc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 669BF8061370; Sun, 19 Nov 2023 06:13:43 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229642AbjKSONH (ORCPT + 99 others); Sun, 19 Nov 2023 09:13:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbjKSONF (ORCPT ); Sun, 19 Nov 2023 09:13:05 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C69DAD8; Sun, 19 Nov 2023 06:13:01 -0800 (PST) Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AJEBDhi005344; Sun, 19 Nov 2023 14:12:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : cc : date : in-reply-to : references : content-type : content-transfer-encoding : mime-version; s=pp1; bh=t6/LH3DJPxANC0T8RNJ8m5HT/bXXnVCsCpC3L0JD3e0=; b=DlYKwozcZKAFOQwZzY7EJ/7iXUyteSoX4QoU1t/VetJG2g/zrwA507i5UYO9jOwE0lue ix6KZNc1z3mPZXgT1RaPEiXSZ3iBsUXr8mpmVlocSD1TA8iZ1VC6Y8ROJ3iLegyXqngQ 4ZaAMGOV7f4KGbckyUDSMFLEhlVWYWXv/Pbo9b+/wi+M7X+8gVrHW6XMa7khrODv4HJq QmIVjIREaS0efzWnPGVwklVrGVuHwlRc+OFFGaRng291yDdAhAx9D4w4GxkCXPpnPMIF KLd6GmzOcKkFyWnyjsLrMVNpTNNn0VqZvkjZrGI01fhbNqBUs1lelSwobF0q4u5GB/uh dw== Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3uf7kh1q0p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 19 Nov 2023 14:12:59 +0000 Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3AJBJQRZ002185; Sun, 19 Nov 2023 14:12:58 GMT Received: from smtprelay01.wdc07v.mail.ibm.com ([172.16.1.68]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3uf7yy3gj0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 19 Nov 2023 14:12:58 +0000 Received: from smtpav01.wdc07v.mail.ibm.com (smtpav01.wdc07v.mail.ibm.com [10.39.53.228]) by smtprelay01.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3AJECvE557803150 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 19 Nov 2023 14:12:57 GMT Received: from smtpav01.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A6D2E58055; Sun, 19 Nov 2023 14:12:57 +0000 (GMT) Received: from smtpav01.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 16E555804B; Sun, 19 Nov 2023 14:12:57 +0000 (GMT) Received: from li-f45666cc-3089-11b2-a85c-c57d1a57929f.ibm.com (unknown [9.61.145.128]) by smtpav01.wdc07v.mail.ibm.com (Postfix) with ESMTP; Sun, 19 Nov 2023 14:12:56 +0000 (GMT) Message-ID: Subject: Re: [PATCH v2] rootfs: Fix support for rootfstype= when root= is given From: Mimi Zohar To: Stefan Berger , linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, initramfs@vger.kernel.org, stable@vger.kernel.org, Rob Landley Date: Sun, 19 Nov 2023 09:12:56 -0500 In-Reply-To: <20231114141030.219729-1-stefanb@linux.ibm.com> References: <20231114141030.219729-1-stefanb@linux.ibm.com> Content-Type: text/plain; charset="ISO-8859-15" X-Mailer: Evolution 3.28.5 (3.28.5-22.el8) X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: StZ-f78JR0cXDRCjCRV4M-pUi_xO2dcZ X-Proofpoint-GUID: StZ-f78JR0cXDRCjCRV4M-pUi_xO2dcZ Content-Transfer-Encoding: 7bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-19_13,2023-11-17_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 lowpriorityscore=0 malwarescore=0 phishscore=0 adultscore=0 mlxscore=0 priorityscore=1501 clxscore=1011 bulkscore=0 impostorscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311190108 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sun, 19 Nov 2023 06:13:43 -0800 (PST) On Tue, 2023-11-14 at 09:10 -0500, Stefan Berger wrote: > Documentation/filesystems/ramfs-rootfs-initramfs.rst states: > > If CONFIG_TMPFS is enabled, rootfs will use tmpfs instead of ramfs by > default. To force ramfs, add "rootfstype=ramfs" to the kernel command > line. > > This currently does not work when root= is provided since then > saved_root_name contains a string and initfstype= is ignored. Therefore, > ramfs is currently always chosen when root= is provided. > > The current behavior for rootfs's filesystem is: > > root= | initfstype= | chosen rootfs filesystem ^rootfstype= > ------------+-------------+-------------------------- > unspecified | unspecified | tmpfs > unspecified | tmpfs | tmpfs > unspecified | ramfs | ramfs > provided | ignored | ramfs > > initfstype= should be respected regardless whether root= is given, > as shown below: ^rootfstype= > > root= | initfstype= | chosen rootfs filesystem ^rootfstype= > ------------+-------------+-------------------------- > unspecified | unspecified | tmpfs (as before) > unspecified | tmpfs | tmpfs (as before) > unspecified | ramfs | ramfs (as before) > provided | unspecified | ramfs (compatibility with before) > provided | tmpfs | tmpfs (new) > provided | ramfs | ramfs (new) > > This table represents the new behavior. > > Fixes: 6e19eded3684 ("initmpfs: use initramfs if rootfstype= or root= specified") > Cc: > Reviewed-by: Stefan Berger As the patch author, "Reviewed-by" is unnecessary. Please add a reference to the original patch on which this is based. Link: https://lore.kernel.org/lkml/8244c75f-445e-b15b-9dbf-266e7ca666e2@landley.net/ > Signed-off-by: Rob Landley > Signed-off-by: Stefan Berger > --- Add Changelog as requested. > init/do_mounts.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/init/do_mounts.c b/init/do_mounts.c > index 5fdef94f0864..279ad28bf4fb 100644 > --- a/init/do_mounts.c > +++ b/init/do_mounts.c > @@ -510,7 +510,10 @@ struct file_system_type rootfs_fs_type = { > > void __init init_rootfs(void) > { > - if (IS_ENABLED(CONFIG_TMPFS) && !saved_root_name[0] && > - (!root_fs_names || strstr(root_fs_names, "tmpfs"))) > - is_tmpfs = true; > + if (IS_ENABLED(CONFIG_TMPFS)) { > + if (!saved_root_name[0] && !root_fs_names) > + is_tmpfs = true; > + else if (root_fs_names && !!strstr(root_fs_names, "tmpfs")) > + is_tmpfs = true; > + } > } Please change all "initfstype" references to "rootfstype" in the patch description. Otherwise, Reviewed-and-Tested-by: Mimi Zohar -- Thanks, Mimi