From: Changbin Du <changbin.du@gmail.com>
To: Josh Triplett <josh@joshtriplett.org>
Cc: Dominique Martinet <asmadeus@codewreck.org>,
Changbin Du <changbin.du@gmail.com>,
Eric Van Hensbergen <ericvh@gmail.com>,
Latchesar Ionkov <lucho@ionkov.net>,
linux-kernel@vger.kernel.org,
v9fs-developer@lists.sourceforge.net
Subject: Re: [PATCH v3 0/3] 9p: add support for root file systems
Date: Sun, 20 Jun 2021 11:36:59 +0800 [thread overview]
Message-ID: <20210620033659.s7rohai7dzwpgjur@mail.google.com> (raw)
In-Reply-To: <YMcfKqbCq7ZWAyaO@localhost>
On Mon, Jun 14, 2021 at 02:19:38AM -0700, Josh Triplett wrote:
> 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.
Bellow is all the parameters of non-block rootfs support.
nfs: nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
cifs: cifsroot=//<server-ip>/<share>[,options]
v9fs: v9fsroot=<tag/ip>[,options]
mtd: root=mtd:<identifier> or root=ubi:<identifier>
virtiofs: root=fstag:<tag>
The main problem is we lack a generic handing for non-block rootdev. I think
maybe we can unify all of above.
non-block: root=<type>:<identifier>
blockdev: root=<bock-dev-path> or root=<blockdev major/minor>
Then:
nfs: root=nfs:[<server-ip>:]<root-dir> rootflags=[nfs-options]
cifs: root=cifs://<server-ip>/<share> rootflags=[options]
v9fs: root=9p:<tag/ip> rootflags=[options]
mtd: root=mtd:<identifier> rootflags=[options]
ubi: root=ubi:<identifier> rootflags=[options]
virtiofs: root=virtiofs:<tag> rootflags=[options]
And maybe we can also remove all the special fs code out of init/do_mounts.c.
--
Cheers,
Changbin Du
next prev parent reply other threads:[~2021-06-20 3:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-06 23:09 Changbin Du
2021-06-06 23:09 ` [PATCH v3 1/3] " Changbin Du
2021-06-07 1:06 ` kernel test robot
2021-06-14 1:09 ` Changbin Du
2021-06-06 23:09 ` [PATCH v3 2/3] 9p: doc: move to a new dedicated folder Changbin Du
2021-06-06 23:09 ` [PATCH v3 3/3] 9p: doc: add v9fsroot description Changbin Du
2021-06-06 23:45 ` [PATCH v3 0/3] 9p: add support for root file systems Dominique Martinet
2021-06-14 8:57 ` Josh Triplett
2021-06-14 9:01 ` Dominique Martinet
2021-06-14 9:19 ` Josh Triplett
2021-06-20 3:36 ` Changbin Du [this message]
2021-06-20 4:16 ` Dominique Martinet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210620033659.s7rohai7dzwpgjur@mail.google.com \
--to=changbin.du@gmail.com \
--cc=asmadeus@codewreck.org \
--cc=ericvh@gmail.com \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lucho@ionkov.net \
--cc=v9fs-developer@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®