summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorMaurizio Lombardi <mlombard@redhat.com>2014-05-27 12:48:56 -0400
committerBen Hutchings <ben@decadent.org.uk>2014-07-11 13:33:38 +0100
commit2b3169d262706a577fe4ffdaaad7599cb529d3e1 (patch)
tree03b4ab3216b21af820b7286b1abe00926f9f6b0f /fs
parent69c9183261e692f6901de00b5e7024a58d69849c (diff)
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 <mlombard@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/mballoc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 81feb175c76e..7168eebd663c 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -3067,7 +3067,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 */