From: "Daniel Martín Gómez" <dalmemail@gmail.com>
To: dalmemail@gmail.com
Cc: Luis de Bethencourt <luisbg@kernel.org>,
Salah Triki <salah.triki@gmail.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH] befs: Fix incorrect superblock consistency check
Date: Mon, 18 Nov 2024 18:45:19 +0100 [thread overview]
Message-ID: <20241118174519.17951-1-dalmemail@gmail.com> (raw)
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.
Signed-off-by: Daniel Martín Gómez <dalmemail@gmail.com>
---
fs/befs/super.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/fs/befs/super.c b/fs/befs/super.c
index 7c50025c99d8..a900ef8402af 100644
--- a/fs/befs/super.c
+++ b/fs/befs/super.c
@@ -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 ||
--
2.39.5
next reply other threads:[~2024-11-18 17:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-18 17:45 Daniel Martín Gómez [this message]
2024-11-19 20:07 ` [PATCH] befs: Fix incorrect superblock consistency check Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241118174519.17951-1-dalmemail@gmail.com \
--to=dalmemail@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luisbg@kernel.org \
--cc=salah.triki@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox