add tytso's DCO
[ext4-patch-queue.git] / fix-fencepost-in-s_first_meta_bg-validation
blobfadd661fe575aa5cb0bfb7f10c31596c94a79d71
1 ext4: fix fencepost in s_first_meta_bg validation
3 It is OK for s_first_meta_bg to be equal to the number of block group
4 descriptor blocks.  (It rarely happens, but it shouldn't cause any
5 problems.)
7 https://bugzilla.kernel.org/show_bug.cgi?id=194567
9 Fixes: 3a4b77cd47bb837b8557595ec7425f281f2ca1fe
10 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 Cc: stable@vger.kernel.org
12 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
13 index dde14a7ac6d7..a673558fe5f8 100644
14 --- a/fs/ext4/super.c
15 +++ b/fs/ext4/super.c
16 @@ -3860,7 +3860,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
17         db_count = (sbi->s_groups_count + EXT4_DESC_PER_BLOCK(sb) - 1) /
18                    EXT4_DESC_PER_BLOCK(sb);
19         if (ext4_has_feature_meta_bg(sb)) {
20 -               if (le32_to_cpu(es->s_first_meta_bg) >= db_count) {
21 +               if (le32_to_cpu(es->s_first_meta_bg) > db_count) {
22                         ext4_msg(sb, KERN_WARNING,
23                                  "first meta block group too large: %u "
24                                  "(group descriptor block count %u)",