From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ma Haijun Date: Wed, 8 Jan 2014 06:49:43 +0800 Subject: [U-Boot] [PATCH] fs/ext4: fix partition size get truncated in calculation Message-ID: <1389134983-9510-1-git-send-email-mahaijuns@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- fs/ext4/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/dev.c b/fs/ext4/dev.c index 787e041..e0b513a 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; } -- 1.8.3.2