From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFF29C2B9F4 for ; Mon, 14 Jun 2021 17:45:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BF27F61350 for ; Mon, 14 Jun 2021 17:45:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233669AbhFNRrV (ORCPT ); Mon, 14 Jun 2021 13:47:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:35032 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231499AbhFNRrU (ORCPT ); Mon, 14 Jun 2021 13:47:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623692716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=SJXA9AEn+G0ZxynctTM6t+9QwrNGEDMN+owDaQzZTPY=; b=cnjoo5TbS9rxixf8AWhOQ7q1V38fYLSqGKvhEYzS18aKKWZm3QEMzjrVF7RoulOnWExfdF XxHeK/hVrUWVcVYKenLjO6r0Vudx0NblvBCtqbesbKeNRNGA4r80yOmf4YM5aB/VzR4WRL ynKZwJQHCEdgtpLz58c9HwC95qgqwmI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-324-cqRUetrsPwGt4IWVIOBmkg-1; Mon, 14 Jun 2021 13:45:15 -0400 X-MC-Unique: cqRUetrsPwGt4IWVIOBmkg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9F9E59F92D; Mon, 14 Jun 2021 17:45:13 +0000 (UTC) Received: from horse.redhat.com (ovpn-114-174.rdu2.redhat.com [10.10.114.174]) by smtp.corp.redhat.com (Postfix) with ESMTP id D491E5C1C2; Mon, 14 Jun 2021 17:45:06 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id 5C9F422054F; Mon, 14 Jun 2021 13:45:06 -0400 (EDT) From: Vivek Goyal To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, virtio-fs@redhat.com Cc: vgoyal@redhat.com, miklos@szeredi.hu, stefanha@redhat.com, dgilbert@redhat.com, viro@zeniv.linux.org.uk, dhowells@redhat.com, richard.weinberger@gmail.com, hch@infradead.org, asmadeus@codewreck.org, v9fs-developer@lists.sourceforge.net Subject: [PATCH v2 0/2] Add support to boot virtiofs and 9pfs as rootfs Date: Mon, 14 Jun 2021 13:44:52 -0400 Message-Id: <20210614174454.903555-1-vgoyal@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, We want to be able to compile in virtiofs/9pfs in kernel and then boot kernel and mount virtiofs/9pfs as root filesystem. Currently there does not seem to be any good way to be able to do that. There seem to be some hacky ways like prefixing filesystem tag with "mtd" or naming the filesystem tag as "/dev/root" to mount viritofs. Both viritofs and 9pfs have the notion of a "tag" to mount a filesystem and they take this "tag" as a source argument of the mount. Filesystem understands how to handle the tag. Current code already has hooks to mount mtd/ubi/cifs/nfs root filesystems (apart of regular block based filesystems). So intead of creating two separate hooks for two filesystems, I have tried creating a hook for tag based filesystems. And now both the filesystems benefit from it. This is generic enough that I think many more use cases might be able to take advantage of it down the line. Vivek Goyal (2): init/do_mounts.c: Add a path to boot from tag based filesystems init/do_mounts.c: Add 9pfs to the list of tag based filesystems init/do_mounts.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) -- 2.25.4