diff options
author | Xiaoguang Wang <wangxg.fnst@cn.fujitsu.com> | 2014-07-28 04:26:36 +0200 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2014-07-28 04:26:36 +0200 |
commit | b27b1535acc0e97b7435bccf205b3fe9c782afac (patch) | |
tree | 0bd7468d36828c1f7b28d7e60b7a4673e941d402 /fs/ext4/mballoc.c | |
parent | ext4: make ext4_has_inline_data() as a inline function (diff) | |
download | linux-b27b1535acc0e97b7435bccf205b3fe9c782afac.tar.xz linux-b27b1535acc0e97b7435bccf205b3fe9c782afac.zip |
ext4: fix wrong size computation in ext4_mb_normalize_request()
As the member fe_len defined in struct ext4_free_extent is expressed as
number of clusters, the variable "size" computation is wrong, we need to
first translate fe_len to block number, then to bytes.
Signed-off-by: Xiaoguang Wang <wangxg.fnst@cn.fujitsu.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
Diffstat (limited to 'fs/ext4/mballoc.c')
-rw-r--r-- | fs/ext4/mballoc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 18a16191249a..0e9466f9e767 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -3075,8 +3075,9 @@ ext4_mb_normalize_request(struct ext4_allocation_context *ac, (23 - bsbits)) << 23; size = 8 * 1024 * 1024; } else { - start_off = (loff_t)ac->ac_o_ex.fe_logical << bsbits; - size = ac->ac_o_ex.fe_len << bsbits; + start_off = (loff_t) ac->ac_o_ex.fe_logical << bsbits; + size = (loff_t) EXT4_C2B(EXT4_SB(ac->ac_sb), + ac->ac_o_ex.fe_len) << bsbits; } size = size >> bsbits; start = start_off >> bsbits; |