diff options
author | Patrick Delaunay <patrick.delaunay@foss.st.com> | 2023-03-08 09:49:54 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-03-22 12:51:14 -0400 |
commit | 9905cae65e03335aefcb1ebfab5b7ee62d89f64e (patch) | |
tree | adb43064bab63c63fc3a164866ff6de66bf5b918 /fs/ext4 | |
parent | a6992bf40d89e3147e319bdae01bf544a65092fc (diff) | |
download | u-boot-9905cae65e03335aefcb1ebfab5b7ee62d89f64e.tar.gz u-boot-9905cae65e03335aefcb1ebfab5b7ee62d89f64e.tar.bz2 u-boot-9905cae65e03335aefcb1ebfab5b7ee62d89f64e.zip |
fs: ext4: check the minimal partition size to mount
No need to mount a too small partition to handle a EXT4 file system.
This patch add a test on partition size before to read the
SUPERBLOCK_SIZE buffer and avoid error latter in fs_devread() function.
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/ext4_common.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c index f50de7c089..9a9c520e22 100644 --- a/fs/ext4/ext4_common.c +++ b/fs/ext4/ext4_common.c @@ -2373,6 +2373,10 @@ 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; |