]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
fs/ext4: fix partition size get truncated in calculation
authorMa Haijun <mahaijuns@gmail.com>
Tue, 7 Jan 2014 22:49:43 +0000 (06:49 +0800)
committerTom Rini <trini@ti.com>
Mon, 20 Jan 2014 15:09:38 +0000 (10:09 -0500)
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 <mahaijuns@gmail.com>
fs/ext4/dev.c

index 787e04133a5dd23b1e4f627fa634d624a61b0dfb..e0b513a4efb9f595ccec817bd5cce5c2c7b9ff6b 100644 (file)
@@ -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;
 }