Received: by 10.223.176.5 with SMTP id f5csp1948722wra; Wed, 31 Jan 2018 14:08:57 -0800 (PST) X-Google-Smtp-Source: AH8x226DX3dO2JcykpT96WNwlXOGxDBeFP6zJEqd0Cqhl1JC6PfnRIEPalKU6tNUpOdb2ezz2Q1H X-Received: by 2002:a17:902:5269:: with SMTP id z96-v6mr14660272plh.392.1517436537352; Wed, 31 Jan 2018 14:08:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517436537; cv=none; d=google.com; s=arc-20160816; b=tnnh4koJ0mnjMmTK+U+rcM400ir9d5CAmkdEMTEdrrz8o4q6remqPpRmDy1XDXaRfe AzMMVxskqpJ7TaUYOiP/BGR/t1/C8dqnRr46YhlCWJl4ibX9OiEWAeYC0RaByDCsPELh av/OCAvZRA3gatBGqvwYJwnwjhxgv6vtIN7Oa1EfGK8HhdT2oicr2RhNhCm8kjYDiCEc a46KU8/VvYUtBG663PtkBnD2MPYX9NGSDIZgh5dsZAZDglUKylfsqH9qmC6T+GQVkdSe kratNhfJ8I9lmrIf21wa2fRK3RbaHSiqPuUv91jHqAou863EbGwYqHrd9XgPJsIFh3GH 2QIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:cc:to:from:subject :arc-authentication-results; bh=ifehXcTRUsgX7hB2WHsPCaLQ/s+m08be5RxR5+jDCDw=; b=KofBuT57rNgm2Qyprno9b3r4d6fACYCW8LG0PmPQMpwheVqGc+5e/VQ10RzqEsUmVB 7YT/hkYB/7VggVEHFIBeQAQICljoeqLrkFz240m7cGtu6z0wYuvYnhg419oAr0bez8aG cf9+48yQKMX80uNSUzHMnvLWkFnjvnCcKzx0pQQoE0Njgtbuqe6hINulM3B3M8MMcZ0N lgUgMoA0UiihDwo8EMhIhYpoleMXja0Rt+OFdUIwWExUV4F6mTZpq+5CDz+g0LoNg83F MeDPxPKjCJQHcoZ/xW/oLxOuDEsACp0s+xDsTBuY4niZ0aOHAqMvPx/7ulQR5RXeTEC5 xzXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d12si11745231pgv.538.2018.01.31.14.08.42; Wed, 31 Jan 2018 14:08:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753434AbeAaWHP (ORCPT + 99 others); Wed, 31 Jan 2018 17:07:15 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:37444 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753395AbeAaWHM (ORCPT ); Wed, 31 Jan 2018 17:07:12 -0500 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0VM5Bjr116216 for ; Wed, 31 Jan 2018 17:07:11 -0500 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fujbh2dvk-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 31 Jan 2018 17:07:11 -0500 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 31 Jan 2018 22:07:08 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 31 Jan 2018 22:07:04 -0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0VM74t311862058; Wed, 31 Jan 2018 22:07:04 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5F03642045; Wed, 31 Jan 2018 22:00:10 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 91DD942041; Wed, 31 Jan 2018 22:00:09 +0000 (GMT) Received: from dhcp-9-2-55-114.watson.ibm.com (unknown [9.2.55.114]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 31 Jan 2018 22:00:09 +0000 (GMT) Subject: Re: [RFC PATCH] rootfs: force mounting rootfs as tmpfs From: Mimi Zohar To: Rob Landley , initramfs Cc: Taras Kondratiuk , Victor Kamensky , linux-security-module , Al Viro , linux-kernel Date: Wed, 31 Jan 2018 17:07:03 -0500 In-Reply-To: <1814af5c-170d-39c0-58fd-02eb7216e008@landley.net> References: <1517348777.3469.5.camel@linux.vnet.ibm.com> <1814af5c-170d-39c0-58fd-02eb7216e008@landley.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 18013122-0008-0000-0000-000004C81937 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18013122-0009-0000-0000-00001E5BB4E9 Message-Id: <1517436423.3469.237.camel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-31_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801310275 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2018-01-31 at 13:32 -0600, Rob Landley wrote: > On 01/30/2018 03:46 PM, Mimi Zohar wrote: > > Commit 16203a7a9422 ("initmpfs: make rootfs use tmpfs when CONFIG_TMPFS > > enabled") introduced using tmpfs as the rootfs filesystem. The use of > > tmpfs is limited to systems that do not specify "root=" on the boot > > command line. > > > > Without the check "!saved_root_name[0]", rootfs uses tmpfs. As there > > must be a valid reason for this check, this patch introduces a new boot > > command line option named "noramfs" to force rootfs to use tmpfs. > > > > Signed-off-by: Mimi Zohar > > How about just: > > diff --git a/init/do_mounts.c b/init/do_mounts.c > index 7cf4f6d..af66ede 100644 > --- a/init/do_mounts.c > +++ b/init/do_mounts.c > @@ -632,8 +632,8 @@ int __init init_rootfs(void) > if (err) > return err; > > - if (IS_ENABLED(CONFIG_TMPFS) && !saved_root_name[0] && > - (!root_fs_names || strstr(root_fs_names, "tmpfs"))) { > + if (IS_ENABLED(CONFIG_TMPFS) && (!saved_root_name[0] || > + !strcmp(saved_root_name, "tmpfs"))) { > err = shmem_init(); > is_tmpfs = true; > } else { > > (Obviously-signed-off-by: Rob Landley ) > > I.E. if you somehow just can't stop yourself from specifying root= when > using rootfs, have "root=tmpfs" do what you want. I tried overloading "rootfstype=tmpfs", before posting this work around, but for some reason that just doesn't work. > > (The old "I configured in tmpfs and am using rootfs but I want that rootfs > to be ramfs, not tmpfs" code doesn't seem to be a real-world concern, does > it?) I must be missing something.  Which systems don't specify "root=" on the boot command line.  If we want to include and restore xattrs, there needs to be a way of using tmpfs. Mimi > > > --- > > Documentation/admin-guide/kernel-parameters.txt | 2 ++ > > init/do_mounts.c | 15 +++++++++++++-- > > 2 files changed, 15 insertions(+), 2 deletions(-) > > I suppose I should do a documentation update too. Lemme send a proper one > after work... > > Rob > > P.S. While I'm at it, I've meant to wire up rootflags= so you can specify > a memory limit other than 50% forever, I should do that too. And resend > my "make DEVTMPFS_MOUNT apply to initramfs" patch (with the debian bug > workaround)... >