Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2589231pxj; Mon, 14 Jun 2021 02:21:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXNIMJngPNh1/zEbSkfkc+8BbJoMhOr1ybPvYUaBFJKkt2WmyDepBleYDTKes8V6Ye4ocu X-Received: by 2002:a17:906:ca54:: with SMTP id jx20mr13995847ejb.380.1623662477547; Mon, 14 Jun 2021 02:21:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623662477; cv=none; d=google.com; s=arc-20160816; b=xJTB4dnC9jpFgHmKbdovnNQ6LrAjuiJDXnoCd4g15mgJbtlJGT/IpRGR2hzDNj4wlo xVjW02f+SOSGUUL0TS5pTCQqKoujCUb01lg8WCWBdI/mXUZ8hCGVHmp2sWcsYQj7XNTY srrSbY1FzoByrroLn6JQ/OKHSyCvDgL1zBPj3MOprN0NzCSHteJmRiUq2Aa2hzYFlUAr PZH2isRaWi5MC7mFmuOX6/b9FewmYgVHL7ikttfksygjXRjw057pa7mWcPoqMmInACUr F+XP9/eh5rzZyQgLyXViGS6hr4dexOQwioABIuISi5biq79UbGY2M5A6mhUKIJYvJm/G 3zIg== 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=TNb7Vv3M+xUBY+jX7qhdo93LtSVPph1cHTQp/HEoLoc=; b=bj8Gqon9TfcWJxR7EtlWpMC2YNHvizXmDDeb5Q1sB/d+z4D10YtKyiVF2J3OXMzx+g JGI1jdLoOYcTdHi8Czstgs7rGRnLabvWOZ0GceTAH5qxE9xA0QMKvNhu3GFF7z1hova9 QYN9wUkL2+UGLowDgKFekBAFCMfwuYX+HCZFY9M1w4nsjwGVontz9WOEoJIyLNfOqQbS kItJQr3jIGy+/ltUc94pxPQj6/Wq8c6mlKpmP3MPFLr11RHeQ4A2ZqIxK4CR8/SP1jij 8zCTqhnf+DDdjpeYYYuqmCX0Ylw9ZpnNOezfrPbd+6CtxpPAPkUIEl7lnRoZj3Y0+fiu uIjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 13si7540508ejj.226.2021.06.14.02.20.53; Mon, 14 Jun 2021 02:21:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232659AbhFNJVr (ORCPT + 99 others); Mon, 14 Jun 2021 05:21:47 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:53573 "EHLO relay8-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232528AbhFNJVq (ORCPT ); Mon, 14 Jun 2021 05:21:46 -0400 Received: (Authenticated sender: josh@joshtriplett.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 769E01BF20A; Mon, 14 Jun 2021 09:19:40 +0000 (UTC) Date: Mon, 14 Jun 2021 02:19:38 -0700 From: Josh Triplett To: Dominique Martinet Cc: Changbin Du , Eric Van Hensbergen , Latchesar Ionkov , linux-kernel@vger.kernel.org, v9fs-developer@lists.sourceforge.net Subject: Re: [PATCH v3 0/3] 9p: add support for root file systems Message-ID: References: <20210606230922.77268-1-changbin.du@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 14, 2021 at 06:01:44PM +0900, Dominique Martinet wrote: > Josh Triplett wrote on Mon, Jun 14, 2021 at 01:57:54AM -0700: > > On Mon, Jun 07, 2021 at 07:09:19AM +0800, Changbin Du wrote: > > > Just like cifs and nfs, this short series enables rootfs support for 9p. > > > Bellow is an example which mounts v9fs with tag 'r' as rootfs in qemu > > > guest via virtio transport. > > > > > > $ qemu-system-x86_64 -enable-kvm -cpu host -m 1024 \ > > > -virtfs local,path=$rootfs_dir,mount_tag=r,security_model=passthrough,id=r \ > > > -kernel /path/to/linux/arch/x86/boot/bzImage -nographic \ > > > -append "root=/dev/v9fs v9fsroot=r,trans=virtio rw console=ttyS0 3" > > > > Rather than inventing a pseudo-device /dev/v9fs for this, would it > > potentially work to use the existing rootfstype and rootflags options > > for this? rootfstype already determines what filesystem should be used > > to mount the root, and rootflags already provides options for that > > filesystem. > > > > For instance, for the above example: > > rootfstype=9p root=r rootflags=trans=virtio > > > > That would require a bit of fiddling to make rootfstype=9p allow a root > > that's just the mount_tag. If that isn't an option, then even with > > root=/dev/v9fs I think it still makes sense to use the existing > > rootflags for "trans=virtio" rather than creating a new "v9fsroot" > > option for that. > > This doesn't work as is because of the way the code is written, if > there's no block device associated with a root=x option right now it > will lead to kernel panic. > > I replied with folks in Cc but there's another thread on linux-fsdevel@ > with a more generic approach that will build a list of filesystems which > don't require such a block device (either hardcoded with virtiofs and 9p > or based on FS_REQUIRES_DEV), thread started there but there's a second > patch hidden an more discussion below: > https://lore.kernel.org/linux-fsdevel/20210608153524.GB504497@redhat.com/ The patch later on in that thread (either using a list of non-block-device filesystems or the version referenced elsewhere that uses a flag in the filesystem definition) looks really appealing! That's exactly what I was hoping for. That gets us closer to directly translating `mount -t type -o options rootdesc` into `rootfstype=type rootflags=options root=rootdesc` in the general case, rather than having special cases for different filesystems.