befs: Fix incorrect superblock consistency check
PATCH 1/1 befs: Fix incorrect superblock consistency check
The check assumes that blocks_per_ag records the number of blocks in an allocation group, but section 4.5 of Practical File System Design with the Be File System states that "The blocks_per_ag field of the superblock refers to the number of bitmap blocks that are in each allocation group". This causes befs driver to write an error to the log each time a volume is mounted. Change the check to correctly compute the number of blocks on each allocation group using blocks_per_ag.
--- fs/befs/super.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
fs/befs/super.c +5 -2
@@ -101,9 +101,12 @@ befs_check_sb(struct super_block *sb)/* ag_shift also encodes the same information as blocks_per_ag in a -* different way, non-fatal consistency check +* different way, non-fatal consistency check. +* Beware that blocks_per_ag holds the number of bitmap blocks in +* each allocation group. */ -if ((1 << befs_sb->ag_shift) != befs_sb->blocks_per_ag) +if ((1 << befs_sb->ag_shift) != + befs_sb->blocks_per_ag * befs_sb->block_size *8 )befs_error (sb,"ag_shift disagrees with blocks_per_ag." ); if (befs_sb->log_start != befs_sb->log_end ||
Signature · 1 line
2.39.5
Quoted 4 lines
The check assumes that
blocks_per_agrecords the number of blocks in an allocation group, but section 4.5 of Practical File System Design with the Be File System states that "Theblocks_per_agfield of the superblock
…
You may occasionally put more than 55 characters into text lines for an improved change description.
Regards,
Markus