From: Ma Haijun Date: Tue, 7 Jan 2014 22:49:43 +0000 (+0800) Subject: fs/ext4: fix partition size get truncated in calculation X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=f17828830df0d83c680f1703e491ac12703a3d19;p=u-boot.git fs/ext4: fix partition size get truncated in calculation It may cause file system corruption when do a write operation. This issue only affects boards that use 32 bit lbaint_t. Signed-off-by: Ma Haijun --- diff --git a/fs/ext4/dev.c b/fs/ext4/dev.c index 787e04133a..e0b513a4ef 100644 --- a/fs/ext4/dev.c +++ b/fs/ext4/dev.c @@ -41,7 +41,7 @@ void ext4fs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info) get_fs()->dev_desc = rbdd; part_info = info; part_offset = info->start; - get_fs()->total_sect = (info->size * info->blksz) >> + get_fs()->total_sect = ((uint64_t)info->size * info->blksz) >> get_fs()->dev_desc->log2blksz; }