diff options
author | Maurizio Lombardi <mlombard@redhat.com> | 2014-05-27 12:48:56 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-06-30 20:11:55 -0700 |
commit | 04e0002916df7668303e9ec855709327352fc9a2 (patch) | |
tree | 7c8515b78d3bfef6eec6b804dcf0576b264f5125 | |
parent | 28f26f6de7c4a171ff82166a09c0dafb2f936b15 (diff) | |
download | kernel-common-04e0002916df7668303e9ec855709327352fc9a2.tar.gz kernel-common-04e0002916df7668303e9ec855709327352fc9a2.tar.bz2 kernel-common-04e0002916df7668303e9ec855709327352fc9a2.zip |
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | fs/ext4/mballoc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 04a5c7504be9..08ddfdac955c 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -3135,7 +3135,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 */ |