mirror of
https://github.com/eledio-devices/thirdparty-littlefs.git
synced 2025-10-30 16:15:40 +01:00
Fail when block_size doesn't match config
With the previous commit, fail if the superblock block_size doesn't match the config block_size.
This commit is contained in:
3
lfs.c
3
lfs.c
@@ -3762,7 +3762,8 @@ static int lfs_rawmount(lfs_t *lfs, const struct lfs_config *cfg) {
|
||||
lfs->attr_max = superblock.attr_max;
|
||||
}
|
||||
|
||||
if (superblock.block_count != lfs->cfg->block_count)
|
||||
if ((superblock.block_count != lfs->cfg->block_count) ||
|
||||
(superblock.block_size != lfs->cfg->block_size))
|
||||
{
|
||||
err = LFS_ERR_CORRUPT;
|
||||
goto cleanup;
|
||||
|
||||
Reference in New Issue
Block a user