Skip to content

Commit b5b6077

Browse files
maurizio-lombarditytso
authored andcommitted
ext4: fix wrong assert in ext4_mb_normalize_request()
The variable "size" is expressed as number of blocks and not as number of clusters, this could trigger a kernel panic when using ext4 with the size of a cluster different from the size of a block. Cc: [email protected] Signed-off-by: Maurizio Lombardi <[email protected]> Signed-off-by: Theodore Ts'o <[email protected]>
1 parent eeece46 commit b5b6077

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ext4/mballoc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3145,7 +3145,7 @@ ext4_mb_normalize_request(struct ext4_allocation_context *ac,
31453145
}
31463146
BUG_ON(start + size <= ac->ac_o_ex.fe_logical &&
31473147
start > ac->ac_o_ex.fe_logical);
3148-
BUG_ON(size <= 0 || size > EXT4_CLUSTERS_PER_GROUP(ac->ac_sb));
3148+
BUG_ON(size <= 0 || size > EXT4_BLOCKS_PER_GROUP(ac->ac_sb));
31493149

31503150
/* now prepare goal request */
31513151

0 commit comments

Comments
 (0)