Skip to content

Commit

Permalink
befs: add check for ag_shift in superblock
Browse files Browse the repository at this point in the history
ag_shift and blocks_per_ag contain the same information in different ways,
same as block_shift and block_size do. It is worth checking this two are
consistent, but since blocks_per_ag isn't documented as mandatory to use
some implementations of befs don't enforce this, so making it non-fatal if
they don't match and just having it as a warning.

Signed-off-by: Luis de Bethencourt <[email protected]>
Signed-off-by: Salah Triki <[email protected]>
  • Loading branch information
luisbg committed Oct 8, 2016
1 parent d1a8c70 commit bbe1bd0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fs/befs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ befs_check_sb(struct super_block *sb)
return BEFS_ERR;
}


/* ag_shift also encodes the same information as blocks_per_ag in a
* different way, non-fatal consistency check
*/
if ((1 << befs_sb->ag_shift) != befs_sb->blocks_per_ag)
befs_error(sb, "ag_shift disagrees with blocks_per_ag.");

if (befs_sb->log_start != befs_sb->log_end || befs_sb->flags == BEFS_DIRTY) {
befs_error(sb, "Filesystem not clean! There are blocks in the "
"journal. You must boot into BeOS and mount this volume "
Expand Down

0 comments on commit bbe1bd0

Please sign in to comment.