From: Maurizio Lombardi Date: Tue, 27 May 2014 16:48:56 +0000 (-0400) Subject: ext4: fix wrong assert in ext4_mb_normalize_request() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=dc10f332a7fce531cd44fc5984286369a6bb71f0;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git ext4: fix wrong assert in ext4_mb_normalize_request() commit b5b60778558cafad17bbcbf63e0310bd3c68eb17 upstream. 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. Signed-off-by: Maurizio Lombardi Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index fba960ee26de..16bb6591561b 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -3116,7 +3116,7 @@ ext4_mb_normalize_request(struct ext4_allocation_context *ac, } BUG_ON(start + size <= ac->ac_o_ex.fe_logical && start > ac->ac_o_ex.fe_logical); - BUG_ON(size <= 0 || size > EXT4_CLUSTERS_PER_GROUP(ac->ac_sb)); + BUG_ON(size <= 0 || size > EXT4_BLOCKS_PER_GROUP(ac->ac_sb)); /* now prepare goal request */