Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2949237pxj; Mon, 14 Jun 2021 10:46:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYjxBIhQzRgSS/UOjqzinmjjoSXEsRgLGfy8bjo3C24Eth89g3LIe1rFDfIpqAdPEB3aky X-Received: by 2002:a17:906:b2c1:: with SMTP id cf1mr15927837ejb.544.1623692794031; Mon, 14 Jun 2021 10:46:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623692794; cv=none; d=google.com; s=arc-20160816; b=vtvLsc2w0NZa5ITMI2dbKwS15QAJMTZyifdb89VBWhl6X6dvfrdop4Xosb+Z9udJFR C/fTPHDUsCkwV9St3v5/eDFmStpDHeMo5el14uLH9RquQnTjRxjnq1aLdU8Y7WCIHSju 1lYwFdhNeRKubH6+PRmzAqMZOPU2Xa7YxVFWTb7YX05zYbw179erEDQ0V+bkYhnpzVNE 6m4gaWYI7njdTNBkDK5KMCIFPw4ckL644d17hTZlR6TrfCpl+0hBT/vdbk8XqEpFmUBs RpGR3wpI2tF2rdOTqdXksNnp6o2hgprtiCtFaiLSFjKwxTP3mJuYfdHbtjcrIj4UwuIm 6B5w== 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=SJXA9AEn+G0ZxynctTM6t+9QwrNGEDMN+owDaQzZTPY=; b=ctgzC/JT5bkbILynPCNkXeLhKssJnWdlpcX0WI4zLJLqVsY87GJ/pC1pDsrORUPFxw DKdGHmJ9vCrClTGcS96k0Ibk/R3ZF9+NMP9H6nGSjtcQC9G8DPj/JN7uFzofI1hJ9dPK VdcPCs7sNJPWQX0uLCLAlaFUqs5q26+4OkfowJ1Mpr2eLJlDWsxBDrcikzqCSFd/Mxpz B4It9ie88uXvSZTWqiPP7hAneAeRYsE9pkgYcrcz98ScUTJfdGlE4Qny7IBH8pwJKaxJ hrn1pCIW6rk3IsEChXAq1szpJYwzC/94HYWl6KYuV/qsDcY6KlRuv6aC5Zm4EMhFGDxo wiCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cnjoo5Tb; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 20si2340218ejj.363.2021.06.14.10.46.10; Mon, 14 Jun 2021 10:46:34 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cnjoo5Tb; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233456AbhFNRrU (ORCPT + 99 others); Mon, 14 Jun 2021 13:47:20 -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