diff options
author | Colin Foster <colin.foster@in-advantage.com> | 2021-08-17 23:49:58 +0300 |
---|---|---|
committer | Christopher Haster <chaster@utexas.edu> | 2022-04-10 20:53:33 +0300 |
commit | cf274e6ec62a26455caae0801c410f9bb8214ef3 (patch) | |
tree | df73d7af0c5f782aa2fb78a9417ef2fe11ca706a /lfs.c | |
parent | 487df12dde704af32afb3c6488a8abe2d1c405d4 (diff) |
Squash of CR changes
- 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
Diffstat (limited to 'lfs.c')
-rw-r--r-- | lfs.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -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; } } |