]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
Revert "fs: ext4: check the minimal partition size to mount"
authorSean Anderson <seanga2@gmail.com>
Sat, 30 Sep 2023 20:42:46 +0000 (16:42 -0400)
committerTom Rini <trini@konsulko.com>
Wed, 18 Oct 2023 00:50:52 +0000 (20:50 -0400)
This check breaks small partitions (under 1024 blocks) because part_length
is in units of part.blksz and not bytes. Given the purpose of this
function, we really want to make sure the partition is SUPERBLOCK_START +
SUPERBLOCK_SIZE (2048) bytes so we can call ext4_read_superblock without
error.

The obvious solution is to convert callers from things like

ext4fs_mount(part_info.size)

to

ext4fs_mount(part_info.size * part_info.blksz);

However, I'm not really a fan of the bloat that would cause, especially
since the error is now suppressed. I think the best course of action here
is to just revert the patch.

This reverts commit 9905cae65e03335aefcb1ebfab5b7ee62d89f64e.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
fs/ext4/ext4_common.c

index 9a9c520e22ca314ab860886a15c2ea3cc2b24ff3..f50de7c089e6333ecf564cb73b72df61311aaf32 100644 (file)
@@ -2373,10 +2373,6 @@ int ext4fs_mount(unsigned part_length)
        struct ext2_data *data;
        int status;
        struct ext_filesystem *fs = get_fs();
-
-       if (part_length < SUPERBLOCK_SIZE)
-               return 0;
-
        data = zalloc(SUPERBLOCK_SIZE);
        if (!data)
                return 0;