From patchwork Tue Dec 23 01:16:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1065 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=1766452618; bh=FCRWYd2LiQw/qRCym0ufUWvBI7O0fnrGB9dYECp4ass=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Qu+NFELRBjhpCdok2w9s6kdU2bWjHrSG0HBkOkWPNHXwees3r0dpnM1M3x5W0D6q0 4S6sM+CrNqGGJ9Xay0vAB2lQun+XE3R/Ku+79sxrsTCVNR8AqRj+LGC2MF9/zTWqhT PgJphliLWdiR2zeFLeabl7MtptjT6YbFPJYwePL12neoo8wSqLPHbXXyTzGXVW+qKQ 0S/mKJDvw/D4ewShplLtOBRMtlVt3OV3TFYwFaGkdKSnBoRqntkvf0ENhVGtITEq1P GSfRPkPuB38AdOGzTg3/szgIpwzr0j18+S5cz7nepVaniTJD9jPx4Ek4yad/hcR+1b K1lbOq7K0wS1g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4450464DB3 for ; Mon, 22 Dec 2025 18:16:58 -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 rBsPL2tKfwnH for ; Mon, 22 Dec 2025 18:16:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766452618; bh=FCRWYd2LiQw/qRCym0ufUWvBI7O0fnrGB9dYECp4ass=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Qu+NFELRBjhpCdok2w9s6kdU2bWjHrSG0HBkOkWPNHXwees3r0dpnM1M3x5W0D6q0 4S6sM+CrNqGGJ9Xay0vAB2lQun+XE3R/Ku+79sxrsTCVNR8AqRj+LGC2MF9/zTWqhT PgJphliLWdiR2zeFLeabl7MtptjT6YbFPJYwePL12neoo8wSqLPHbXXyTzGXVW+qKQ 0S/mKJDvw/D4ewShplLtOBRMtlVt3OV3TFYwFaGkdKSnBoRqntkvf0ENhVGtITEq1P GSfRPkPuB38AdOGzTg3/szgIpwzr0j18+S5cz7nepVaniTJD9jPx4Ek4yad/hcR+1b K1lbOq7K0wS1g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 19A2E64D45 for ; Mon, 22 Dec 2025 18:16:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766452616; bh=ilSdrzho/2RfD3h5iCaybHEi2rvFYx4YN3thjQrVpe4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tm/gSLG3tUjRo/2fWL5x8DIWU+miRn0wWc4GEni1eEN6NPCW6rfq4cj3OfPT7eqdW rigQsUL/SI/gYODwEalFjvjXC3vN6ikpk8W6Wkx0cREq+sYsNSHUeSNEFKbAIeYeA/ 0+AKb/UzKiUYnOfrOpYTTZh8n7PbtNVwSUc7tgweOUAtwk0QiNbpbz5mSdLWxsKEiE oD39ceHxMY49GzZk+th4ffJa/DYI9h7HawF7WZSxkg4M/P2u8z/27upzfM6ncnscWb UAU8HoArSYlEHKBE5ho2JYPT+afxxCdrjzCvXTKwmyolC5fP2dUjJ42nG4fj7xFscw Z1+QRmAKnL+xQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2CC7C64D43; Mon, 22 Dec 2025 18:16:56 -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 ogf_myFak7qP; Mon, 22 Dec 2025 18:16:56 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766452613; bh=7GsFbui91VG0KahIHgRRKSMcoxx3as8ge6t3y67/GBo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wma5jzbTnlrx833B1s9V+se0HHUyCb7/+Aw6foVM9NTSx8X08HZyjHeD8wCVe2UO3 h/jYARwtYms0CLjfL92SAXNuLUqUGUaGMpf9u8vfX6adlmYEhrC4VjBDefyr6I9muE Wd58sQImtjqJZMZPTug2iMT9A9vE9dIDMa57V8II/1kEMdCB6i23td9rp6s5dkvnZU AKgErQymq9RI+1BLa+ZvDMU12Qvsbzx6x4Q+GWgXDiZ/8p5e0fUaFVSza1Q5x3dqr0 H6mCyx/0kd4/KOs83qzDU86C0vcJ6DZBF8+4fxbjynOccyeyO9oybiN7zZJgTjXHkT reydB2nvkM0Tg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id D5A7D64C17; Mon, 22 Dec 2025 18:16:52 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Dec 2025 18:16:21 -0700 Message-ID: <20251223011632.380026-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251223011632.380026-1-sjg@u-boot.org> References: <20251223011632.380026-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: TZFF3SG2SD7MPDNC3U2QXPGAB75AOL3U X-Message-ID-Hash: TZFF3SG2SD7MPDNC3U2QXPGAB75AOL3U 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: Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 06/12] ext4l: Implement super_set_uuid() to display filesystem UUID 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 The super_set_uuid() function was stubbed as a no-op, causing the filesystem UUID to display as all zeros during mount. Implement it to copy the UUID from the ext4 superblock to the VFS super_block structure. Before: mounted filesystem 00000000-0000-0000-0000-000000000000 r/w After: mounted filesystem d4ddb235-df85-4963-a923-7cddc5ad9355 r/w Add a way to read from tests as well. Co-developed-by: Claude Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 11 +++++++++-- fs/ext4l/interface.c | 13 +++++++++++++ include/ext4l.h | 7 +++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 4b7b5d02c82..4b019b77d27 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -2324,8 +2324,15 @@ unsigned int bdev_max_discard_sectors(struct block_device *bdev); /* Task I/O priority - declaration for stub.c */ void set_task_ioprio(void *task, int ioprio); -/* Superblock identity stubs */ -#define super_set_uuid(sb, uuid, len) do { } while (0) +/* Superblock identity functions */ +static inline void super_set_uuid(struct super_block *sb, const u8 *uuid, + unsigned len) +{ + if (len > sizeof(sb->s_uuid.b)) + len = sizeof(sb->s_uuid.b); + memcpy(sb->s_uuid.b, uuid, len); +} + #define super_set_sysfs_name_bdev(sb) do { } while (0) /* diff --git a/fs/ext4l/interface.c b/fs/ext4l/interface.c index 7360f44c92b..2ea3915c637 100644 --- a/fs/ext4l/interface.c +++ b/fs/ext4l/interface.c @@ -51,6 +51,19 @@ struct disk_partition *ext4l_get_partition(void) return &ext4l_partition; } +/** + * ext4l_get_uuid() - Get the filesystem UUID + * @uuid: Buffer to receive the 16-byte UUID + * Return: 0 on success, -ENODEV if not mounted + */ +int ext4l_get_uuid(u8 *uuid) +{ + if (!ext4l_sb) + return -ENODEV; + memcpy(uuid, ext4l_sb->s_uuid.b, 16); + return 0; +} + /** * ext4l_set_blk_dev() - Set the block device for ext4l operations * @blk_dev: Block device descriptor diff --git a/include/ext4l.h b/include/ext4l.h index 5a300fd6559..dead8ba8e6f 100644 --- a/include/ext4l.h +++ b/include/ext4l.h @@ -28,4 +28,11 @@ int ext4l_probe(struct blk_desc *fs_dev_desc, */ void ext4l_close(void); +/** + * ext4l_get_uuid() - Get the filesystem UUID + * @uuid: Buffer to receive the 16-byte UUID + * Return: 0 on success, -ENODEV if not mounted + */ +int ext4l_get_uuid(u8 *uuid); + #endif /* __EXT4L_H__ */