Message ID | 20231113211735.23267-1-stefanb@linux.ibm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp1481697vqg; Mon, 13 Nov 2023 13:18:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IHOfjcScKp0i2bW67IYVuHKosZYVexb8y/IeoXlMHtllvKSJHKIW4YlMR0fwSZbBmLqciAd X-Received: by 2002:a17:90b:1e08:b0:27c:f8bd:9a98 with SMTP id pg8-20020a17090b1e0800b0027cf8bd9a98mr4848626pjb.40.1699910298486; Mon, 13 Nov 2023 13:18:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699910298; cv=none; d=google.com; s=arc-20160816; b=u/gRVZ6Jci3EyMkWca4e40Y6MThrFt32ZlWQAjcrn85CWQN56lkIhFneClgU4vfojR Vh43ZlIBFpMXp4A/9y6wNq2JnD8ofcCTtdN/ZYruw0cbh9x3bbOY3Al+IQ1NDryNdlDa 62Ys3rV1LzBEMpK1PTv4OrdinD7v434ZumhhAVH1xBkk/Ir1mirgvbu25AC1PwjYvOSl IE9H/NUvQ94Rokj45z5i2Z1WCwUfsTwhOXMh22xt7Iz02+tDzsVlM+LWT1+vdTahbcYw P5sAX6WX6hbK+wzjAqKGgK3vi6HYyhrAOddx/1Uqlo1iPj0hDb75SfqMlk3ZtBlhfOWD sZsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=DcKCsfaeL9qnBC4+oF1N2AZzZXhsJKTussTqX7apm70=; fh=Q4ok5oBJw4VV1XHUxAuWdi2/I7sgtHwqC/iVbixhyEM=; b=x/sMWbGby+QfTCksOsekQMrZKBd3hWgUndZBMr+GhIIapBoyxebOAjavIl8FGXoI+M +yRrREMSFKXhHVreffp3BKcvGxBuIw/Xn+FKYVHt4YAFChIEUM1UKpLPShiyW1vEcXld KQNFjAvi99SobEYY7dmBzLUJAEzNSXW7LCVgL7Uz2vfULTwqJMOdH8IQhkET7KeOZyZR QjKLJgWF3L6dCymoht1DWFtuKj8E0kBlVWmAjIMn28sxlRBRkhVlzdE1hy/4IdvjICuR UDN2vPVPPNNZUY8pgsiA+wJOvOgEY7cWEJFWw8qZ5sfJVcip2CEpjxeybfIwwJMFxNQ+ 6rgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=ldH1ADaf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id in1-20020a17090b438100b0027491bac826si6489609pjb.140.2023.11.13.13.18.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 13:18:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=ldH1ADaf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 0DCA780569AD; Mon, 13 Nov 2023 13:18:16 -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 S231177AbjKMVSA (ORCPT <rfc822;lhua1029@gmail.com> + 30 others); Mon, 13 Nov 2023 16:18:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229715AbjKMVR7 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 13 Nov 2023 16:17:59 -0500 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DCB3D5F; Mon, 13 Nov 2023 13:17:55 -0800 (PST) Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3ADL5XdK027120; Mon, 13 Nov 2023 21:17:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=DcKCsfaeL9qnBC4+oF1N2AZzZXhsJKTussTqX7apm70=; b=ldH1ADaf9loKKeYFNy3AVUatUnS9uyUsCd4mNWIqtOzLhpT4TJfIhrA5cLL/wB6aYCSk VG2bnDmkwEGMNYJwJoQcsmOS856o+Ej7+yPO4WliEuEUCYFsuo6hnzl1eq8XquaZzDsO IevHQ0GxSTizHTwcUcoSRRVezrc7gSivgG1ZJLCfJDiLFfZjDntTBJIe8QiuwLSrHYhf yXhV37dVVxuDDDD/H8bKFZW0IbMs4Wc4y8T0QLh+TSH8hh9IILzsaB6UMtA3Ch9DHMH1 hxdBCNyGo5Ow//I0EUhJRIHnZCZM0ZjhP+y/uMh2nxxltS1AicVb6XIZXDs38qowK3SO fA== Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ubu6rgg7q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Nov 2023 21:17:52 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3ADJYXGH014897; Mon, 13 Nov 2023 21:17:52 GMT Received: from smtprelay02.wdc07v.mail.ibm.com ([172.16.1.69]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3uamxn3fc5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Nov 2023 21:17:52 +0000 Received: from smtpav01.wdc07v.mail.ibm.com (smtpav01.wdc07v.mail.ibm.com [10.39.53.228]) by smtprelay02.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3ADLHpdK12583432 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Nov 2023 21:17:51 GMT Received: from smtpav01.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4764D58063; Mon, 13 Nov 2023 21:17:51 +0000 (GMT) Received: from smtpav01.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9F17358059; Mon, 13 Nov 2023 21:17:50 +0000 (GMT) Received: from sbct-3.pok.ibm.com (unknown [9.47.158.153]) by smtpav01.wdc07v.mail.ibm.com (Postfix) with ESMTP; Mon, 13 Nov 2023 21:17:50 +0000 (GMT) From: Stefan Berger <stefanb@linux.ibm.com> To: linux-kernel@vger.kernel.org Cc: zohar@linux.ibm.com, gregkh@linuxfoundation.org, initramfs@vger.kernel.org, Stefan Berger <stefanb@linux.ibm.com>, Rob Landley <rob@landley.net> Subject: [PATCH] rootfs: Fix support for rootfstype= when root= is given Date: Mon, 13 Nov 2023 16:17:35 -0500 Message-ID: <20231113211735.23267-1-stefanb@linux.ibm.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: -XsSHqKBwmkkpOf-KEmMnYmx5r2s0616 X-Proofpoint-GUID: -XsSHqKBwmkkpOf-KEmMnYmx5r2s0616 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-13_12,2023-11-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 lowpriorityscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 priorityscore=1501 phishscore=0 adultscore=0 malwarescore=0 impostorscore=0 clxscore=1011 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311130164 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: <linux-kernel.vger.kernel.org> 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]); Mon, 13 Nov 2023 13:18:16 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782485140891580368 X-GMAIL-MSGID: 1782485140891580368 |
Series |
rootfs: Fix support for rootfstype= when root= is given
|
|
Commit Message
Stefan Berger
Nov. 13, 2023, 9:17 p.m. UTC
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 ------------+-------------+-------------------------- unspecified | unspecified | tmpfs unspecified | tmpfs | tmpfs unspecified | ramfs | ramfs provided | ignored | ramfs initfstype= should be respected regardless whether root= is given, as shown below: root= | initfstype= | chosen rootfs filesystem ------------+-------------+-------------------------- 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") Reviewed-by: Stefan Berger <stefanb@linux.ibm.com> Signed-off-by: Rob Landley <rob@landley.net> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> --- init/do_mounts.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
Comments
On Mon, Nov 13, 2023 at 04:17:35PM -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 > ------------+-------------+-------------------------- > unspecified | unspecified | tmpfs > unspecified | tmpfs | tmpfs > unspecified | ramfs | ramfs > provided | ignored | ramfs > > initfstype= should be respected regardless whether root= is given, > as shown below: > > root= | initfstype= | chosen rootfs filesystem > ------------+-------------+-------------------------- > 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") > Reviewed-by: Stefan Berger <stefanb@linux.ibm.com> > Signed-off-by: Rob Landley <rob@landley.net> > Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> > --- > init/do_mounts.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > Hi, This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree. You are receiving this message because of the following common error(s) as indicated below: - You have marked a patch with a "Fixes:" tag for a commit that is in an older released kernel, yet you do not have a cc: stable line in the signed-off-by area at all, which means that the patch will not be applied to any older kernel releases. To properly fix this, please follow the documented rules in the Documentation/process/stable-kernel-rules.rst file for how to resolve this. If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers. thanks, greg k-h's patch email bot
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; + } }