Skip to content

Commit

Permalink
Revert "fs: ext4: check the minimal partition size to mount"
Browse files Browse the repository at this point in the history
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 9905cae.

Signed-off-by: Sean Anderson <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
Reviewed-by: Patrick Delaunay <[email protected]>
  • Loading branch information
Forty-Bot authored and trini committed Oct 18, 2023
1 parent a0733b3 commit bfcf752
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions fs/ext4/ext4_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bfcf752

Please sign in to comment.