Skip to content

Commit

Permalink
Squash of CR changes
Browse files Browse the repository at this point in the history
- nit: Moving brace to end of if statement line for consistency
- mount: add more debug info per CR
- Fix compiler error from extra parentheses
- Fix superblock typo
  • Loading branch information
colin-foster-in-advantage authored and geky committed Apr 10, 2022
1 parent 487df12 commit cf274e6
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions lfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -3762,10 +3762,17 @@ 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) ||
(superblock.block_size != lfs->cfg->block_size))
{
err = LFS_ERR_CORRUPT;
if (superblock.block_count != lfs->cfg->block_count) {
LFS_ERROR("Invalid block count (%"PRIu32" != %"PRIu32")",
superblock.block_count, lfs->cfg->block_count);
err = LFS_ERR_INVAL;
goto cleanup;
}

if (superblock.block_size != lfs->cfg->block_size) {
LFS_ERROR("Invalid block size (%"PRIu32" != %"PRIu32")",
superblock.block_count, lfs->cfg->block_count);
err = LFS_ERR_INVAL;
goto cleanup;
}
}
Expand Down

0 comments on commit cf274e6

Please sign in to comment.