From patchwork Fri Jan 2 00:50:30 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 83 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767315087; bh=4NgA94o0CeDS7I3Iq36kdi1lUZ9sY/9+noc5Is/QMrM=; h=From:To:Date:CC:Subject:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=qIrqh0rZt0kxRgUMemq4sYZnkaGXLSOtnnf9lyT3VFNUfoL90GKj6F2K7F0k/KiYX UP14dBeR9lmNccgvNxV6DX68wyr9vO3c0BinDEf0MkmGOIXVuiTZaQLHd01FMxhHhk KEtYmMI+CNDIMu0OgnyaWrZqcUbG01v2yzfyurvLWcLh4i+eFXIUITgJMplvUlJUdZ zKtWK6piIDAJvsoV+YSpVD6+UAkhXZ/Qa17eZULufMktIjIT/WCG5uN9bd1e7Rjczm jTL8TFJthj7oay6x/S6xECq3FrSPZbSFM4JvY6CAnq8nxkbQP2C27bXyWjfppFQDut ZSNXzM5eVVZuA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 781E068F58 for ; Thu, 1 Jan 2026 17:51:27 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id UJoaHdaPDbKb for ; Thu, 1 Jan 2026 17:51:27 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767315087; bh=4NgA94o0CeDS7I3Iq36kdi1lUZ9sY/9+noc5Is/QMrM=; h=From:To:Date:CC:Subject:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=qIrqh0rZt0kxRgUMemq4sYZnkaGXLSOtnnf9lyT3VFNUfoL90GKj6F2K7F0k/KiYX UP14dBeR9lmNccgvNxV6DX68wyr9vO3c0BinDEf0MkmGOIXVuiTZaQLHd01FMxhHhk KEtYmMI+CNDIMu0OgnyaWrZqcUbG01v2yzfyurvLWcLh4i+eFXIUITgJMplvUlJUdZ zKtWK6piIDAJvsoV+YSpVD6+UAkhXZ/Qa17eZULufMktIjIT/WCG5uN9bd1e7Rjczm jTL8TFJthj7oay6x/S6xECq3FrSPZbSFM4JvY6CAnq8nxkbQP2C27bXyWjfppFQDut ZSNXzM5eVVZuA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5094368FFD for ; Thu, 1 Jan 2026 17:51:27 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767315083; bh=uY5fR/bvmS31bimuCOD3uRXw84fOalT1Mn4KiFoncjc=; h=From:To:Cc:Subject:Date:From; b=qkcquljG3pac8tlLfteIDzCdyOiATJW16o7Qga9rFOZi/nhwoFOp7n4ey7PLC4Nj8 Ink/TAIGUUq8JW9g+lz8pTsVwMxo0riyZUgliY/Ot6CpQalTZAdUrf0bWkK/HT+aSC gi0GQYdSgZpvINorprYwUnzUhJTYE/FrBxrgVnNr8Fpo+RqLR+7bUKd3ov6brdzic9 CS7Uwywu+mcaklh/sJmdYUp03sX3mihUMokno5+D3ATgSeFWxBCRd0PrDrkj5cyMZl NGOdJtvbo+X/VbW14aOx3WXM0R85Vu+qc1a2SuBKjiGnWLvdhoZfntJio+8zpxoRdB mJxVSeL6UJ8Ag== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5088968F58; Thu, 1 Jan 2026 17:51:23 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id C1BuTFjHjWGs; Thu, 1 Jan 2026 17:51:23 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767315079; bh=C9xxltxrKSXdo4rLOKXqhe8hx/gdELlwR0xTufFxbnc=; h=From:To:Cc:Subject:Date:From; b=EBZ0OWLCREbaTGEF1eAnEIpikC9GKyDzaMRsB6+yt4icp9IHJ6kgnm37ypfEUxPkp XMpV63aQGJzBEZc86PJIuAihiL3DYATvXXwBKlKgxc0GCPQc8EPY6GiBUD3EAU4Om+ RARsdzGKkm7/ZYQYYQxZ85k+zapPXFyT/oLjmL+e81hh05y3jRZ1GVSbgnnHvBur0J i2hg8pN+zfEkXdgc0Epps6V+NZcJhGi3jvDsYvErkUzxt7w83DlrWeM8x1KlPPIiPo Oxb11P5RKmIv4gqfi4D8nhCUSR/Q5FcKoRflZ4RfK5I5qF3cJwcxQVXLaKh7lbDyXf 45CONZ9o/Mo1Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B693D68313; Thu, 1 Jan 2026 17:51:18 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 1 Jan 2026 17:50:30 -0700 Message-ID: <20260102005112.552256-1-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Message-ID-Hash: C7YQCEEFBMC2XDZSDTWH7IN63MOZCLFH X-Message-ID-Hash: C7YQCEEFBMC2XDZSDTWH7IN63MOZCLFH X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 00/30] ext4l: Add write support (part L) List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass This series adds write support to the new ext4l filesystem driver, supporting file creation, modification, and deletion. The main additions are: - File write with journalling support - File deletion (unlink) - Directory creation (mkdir) - Symbolic link creation (ln) - File and directory rename Infrastructure improvements include proper cleanup of journal references when unmounting, safeguards to handle probe without explicit close, and prevention of use-after-free issues with buffer_heads that have active journal_heads. Unlike Linux, which does not need to meticulously free every resource on unmount (since it can do so later as needed), U-Boot must fully clean up. The bootloader may mount and unmount filesystems multiple times during a session, such as loading a kernel from one partition and a device tree from another, or when running tests. Memory leaks accumulate and cause failures, so ext4l includes extra cleanup code that the Linux ext4 driver does not require. The series also enables ext4l for sandbox testing and allows the use of metadata_csum checksums which the existing ext4 driver does not support. Some other tweaks are included: - a fix for mcheck to avoid filling up pre-relocation malloc() - use the correct logo for readthedocs - add a flag to avoid using the video console in tests - a fallback option for finding persistent data-dir At this point ext4l is useable, but there is more work needed, including: - Add MAINTAINERS entry - Add more Kconfig options for various features (to reduce code size) - Enable for ARM and x86 targets - Documentation - Tests for failure cases (to check that the journal is doing its job) (no changes since v1) Simon Glass (30): Update claude file to use uman instead of crosfw sandbox: os: Check executable directory for persistent files sandbox: Add --quiet_vidconsole option to speed up output video: Avoid uclass allocation in video_idle() cyclic video: Unregister cyclic on the last video-device removal video: Correct the U-Boot logo blkmap: Handle read-only slices in write path mcheck: Add Kconfig option for caller string length mcheck: Skip mcheck overhead for pre-relocation allocations Revert "lib: Add CONFIG_LIB_KMEM_CACHE for full kmem_cache support" ext4l: doc: Document ext4l_msgs environment variable ext4l: Move message buffer functions to support.c ext4l: Add inode-tracking lists ext4l: Fix a few problems with handling bh_cache ext4l: Clean up fully when unmounting ext4l: Remove duplicate atomic_add declarations ext4l: Use the real crc16 implementation ext4l: Add a few Kconfig dependencies ext4l: Add bh_cache_release_jbd() to clean up journal references ext4l: Add safeguard to close previous mount in probe ext4l: Prevent freeing buffer_heads with active journal_heads ext4l: Add support for read-only devices ext4l: Add write support ext4l: Add unlink support for file deletion ext4l: Add mkdir support for directory creation ext4l: Add symlink support ext4l: Update symlink to replace existing files ext4l: Add rename support test: fs_helper: Keep metadata_csum enabled for ext4l sandbox: Enable CONFIG_FS_EXT4L CLAUDE.md | 14 +- Kconfig | 11 + arch/sandbox/cpu/os.c | 27 +- arch/sandbox/cpu/start.c | 10 + arch/sandbox/include/asm/state.h | 1 + board/sandbox/sandbox.c | 16 + common/dlmalloc.c | 33 +- common/mcheck_core.inc.h | 5 +- configs/sandbox_defconfig | 2 + doc/arch/sandbox/sandbox.rst | 7 + doc/conf.py | 2 +- doc/usage/environment.rst | 6 + drivers/block/blkmap.c | 3 + drivers/video/video-uclass.c | 40 +- fs/ext4l/Kconfig | 3 + fs/ext4l/ext4.h | 6 + fs/ext4l/ext4_uboot.h | 48 +- fs/ext4l/interface.c | 679 ++++++++++++++++++++++++++-- fs/ext4l/mballoc.c | 4 + fs/ext4l/stub.c | 8 +- fs/ext4l/super.c | 25 +- fs/ext4l/support.c | 156 ++++++- fs/fs_legacy.c | 10 +- include/ext4l.h | 67 +++ include/linux/fs.h | 1 + include/linux/slab.h | 27 +- lib/Kconfig | 8 - lib/Makefile | 1 - lib/kmem_cache.c | 20 - test/fs/ext4l.c | 251 ++++++++++ test/py/tests/fs_helper.py | 13 +- test/py/tests/test_event_dump.py | 1 + test/py/tests/test_fs/test_ext4l.py | 25 + tools/logos/u-boot-logo-text.svg | Bin 0 -> 8552 bytes 34 files changed, 1376 insertions(+), 154 deletions(-) delete mode 100644 lib/kmem_cache.c create mode 100644 tools/logos/u-boot-logo-text.svg