From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B00902FDC5E for ; Thu, 18 Jun 2026 16:13:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781799231; cv=none; b=pFntI/KpMpit5COUM4xheyXD9TOykVgmLwVMuHimCcxR8mczbIBfqAYDjXbiuBbWvRd8ibALYNBxGWJ8g5wPkm62XJcZjU4jKe4Vy/iuC0uud0ptccqYoHrTqcxdKcnAFNNXeXF151j5fCtp+yHGYaM0UBwUUOiINeDNLUj0pEE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781799231; c=relaxed/simple; bh=u1QwI1AOpH0D8IvOYk4BtAtb0C1h3NOndIlroKuUmmA=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=khj2/CvvDnmTMQIT96S0sMCzlPipzJKxGNtl8DF3ibkYNr0sOM/AESnbywpWQWSuR7mjS49wejpbXg+bSHvFo9G4KnMx+CFFM2da8Dl7oPgAl/uxfbY0N34vsPWU8T3kAN56e2s089tE9VsLG+cjosxwowBNrZXFKaFX6YCLp30= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Y8ztyFVv; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Y8ztyFVv" Received: by smtp.kernel.org (Postfix) with ESMTPS id 500ACC2BCC7; Thu, 18 Jun 2026 16:13:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1781799231; bh=u1QwI1AOpH0D8IvOYk4BtAtb0C1h3NOndIlroKuUmmA=; h=From:Subject:Date:To:Cc:Reply-To:From; b=Y8ztyFVvn0/mWLdgz/rF+WLiMMIrWMOEmaeYwZySET3zVq4SHuMqoNHOhDSY9OZ1f nYMoqBusyuQ7X6B/NDY5Oa1PpzShFCPCvhNSoF8emNfNQ/Alnq7/EhxlMApPaZLDhT rlX8njENE6jObTBAoUnKabeZYTuB7QxU6GYdaCJOvEEaQjQ7h8k/VKTFT1A6WLUHg1 ZveOhL5anWsr6TF6Ml/Lym8xk6isJS47E+hc2gdtbGi+QU0S93KO5Gqx/S3CKfEnLB xXHnKofXE6J1eTGB0EFC3XI8ZWStPjjT4Yqti+UR7o933Xnzq7KAYVnZZgQUgaICLU L/CSyXOSOwK/g== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B7EDCD98ED; Thu, 18 Jun 2026 16:13:51 +0000 (UTC) From: Alberto Ruiz via B4 Relay Subject: [PATCH RFC 0/2] RFC: erofs: memory-backed mount for non-page-aligned ranges Date: Thu, 18 Jun 2026 17:13:43 +0100 Message-Id: <20260618-erofs-memback-v1-0-5aa7006a241a@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-B4-Tracking: v=1; b=H4sIAAAAAAAC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIzMDM0Nz3dSi/LRi3dzU3KTE5Gxdg8RUIxMTi6REo+RkJaCegqLUtMwKsHn RSkFuzkqxEMHi0qSs1OQSkElKtbUAXYGDhHYAAAA= X-Change-ID: 20260617-erofs-memback-0ae2448ba2cc To: Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu , Sandeep Dhavale , Hongbo Li , Chunhai Guo Cc: linux-kernel@vger.kernel.org, linux-erofs@lists.ozlabs.org, Javier Martinez Canillas , Brian Masney , Eric Curtin , Alberto Ruiz X-Mailer: b4 0.15.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1781799229; l=2698; i=aruiz@redhat.com; s=20260612; h=from:subject:message-id; bh=u1QwI1AOpH0D8IvOYk4BtAtb0C1h3NOndIlroKuUmmA=; b=0HNeFSvZBySZaDmAoh7zOYZD283faaBQL1pVldiPpNOMZn83Wgwawpurj9yk/z6wf4qeoBfTU FbNGZoPmudFBFuyzRlQQqx9DtP1JYkt7pCdRVbE+qe5Y+yJIcX1kR44 X-Developer-Key: i=aruiz@redhat.com; a=ed25519; pk=d1doFQwve1B/jU9nG5oPl1W5d+t+iFrjkkwk/hD97Ow= X-Endpoint-Received: by B4 Relay for aruiz@redhat.com/20260612 with auth_id=818 X-Original-From: Alberto Ruiz Reply-To: aruiz@redhat.com This series adds a memory-backed ("memback") mode to EROFS that allows mounting an EROFS image directly from a kernel memory region without going through the block layer. I am sending this as an RFC to get EROFS maintainer feedback on this approach before building the full initramfs series on top of it. The memback mode may also be useful for other use cases beyond initramfs where EROFS images need to be served directly from memory, though it may need further hardening for more general use cases. Previous review feedback on the initramfs patches raised concerns about the block layer dependency — this series addresses that by providing a direct memory-backed path. It also adds support for non-page-aligned memory ranges, which is the common case for initramfs images packed at arbitrary cpio boundaries. Supporting non-page-aligned ranges is essential for true zero-copy access — requiring page alignment would force a copy into an aligned buffer before the data can be used, defeating the purpose. The full initramfs integration (init/ changes) that wires up the EROFS initrd detection and layered mount is available for reference here[0]. It implements support for interleaved cpio and EROFS layers, it supports cpio CPU microcode update prefix, and uses overlayfs+tmpfs for write support. This series was developed with the assistance of Claude Opus 4.6. All patches carry an Assisted-by tag. I am providing the kunit testing and I have tested this change against the initramfs series to boot an EROFS initramfs. I welcome feedback on the approach and implementation. Patch 1 adds the core memback implementation. Patch 2 adds a KUnit test that mounts a compressed EROFS image at a non-page-aligned offset and verifies decompressed file contents. [0] https://github.com/aruiz/linux/tree/wip/erofs-initramfs-memback Signed-off-by: Alberto Ruiz --- Alberto Ruiz (2): erofs: add memory-backed mode for non-page-aligned mount erofs: add KUnit test for memory-backed compressed mount fs/erofs/Kconfig | 11 ++++ fs/erofs/Makefile | 2 + fs/erofs/data.c | 33 +++++++++- fs/erofs/internal.h | 53 +++++++++++---- fs/erofs/memback.c | 169 ++++++++++++++++++++++++++++++++++++++++++++++++ fs/erofs/memback_test.c | 151 ++++++++++++++++++++++++++++++++++++++++++ fs/erofs/super.c | 38 +++++++++-- fs/erofs/zdata.c | 16 +++-- 8 files changed, 447 insertions(+), 26 deletions(-) --- base-commit: 6b5a2b7d9bc156e505f09e698d85d6a1547c1206 change-id: 20260617-erofs-memback-0ae2448ba2cc Best regards, -- Alberto Ruiz