From: Andrew Morton Give up. Hope that ext4_fsblk_t is compatiblee with u64 for all do_div() implementations. Cc: Signed-off-by: Andrew Morton --- fs/ext4/balloc.c | 2 +- fs/ext4/ialloc.c | 4 ++-- fs/ext4/super.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff -puN fs/ext4/balloc.c~ext4-64-bit-divide-fix-fix fs/ext4/balloc.c --- a/fs/ext4/balloc.c~ext4-64-bit-divide-fix-fix +++ a/fs/ext4/balloc.c @@ -34,7 +34,7 @@ void ext4_get_group_no_and_offset(struct ext4_grpblk_t offset; blocknr = blocknr - le32_to_cpu(es->s_first_data_block); - offset = do_div((u64)blocknr, EXT4_BLOCKS_PER_GROUP(sb)); + offset = do_div(blocknr, EXT4_BLOCKS_PER_GROUP(sb)); if (offsetp) *offsetp = offset; if (blockgrpp) diff -puN fs/ext4/ialloc.c~ext4-64-bit-divide-fix-fix fs/ext4/ialloc.c --- a/fs/ext4/ialloc.c~ext4-64-bit-divide-fix-fix +++ a/fs/ext4/ialloc.c @@ -275,7 +275,7 @@ static int find_group_orlov(struct super avefreei = freei / ngroups; freeb = percpu_counter_read_positive(&sbi->s_freeblocks_counter); avefreeb = freeb; - do_div((u64)avefreeb, ngroups); + do_div(avefreeb, ngroups); ndirs = percpu_counter_read_positive(&sbi->s_dirs_counter); if ((parent == sb->s_root->d_inode) || @@ -305,7 +305,7 @@ static int find_group_orlov(struct super } blocks_per_dir = ext4_blocks_count(es) - freeb; - do_div((u64)blocks_per_dir, ndirs); + do_div(blocks_per_dir, ndirs); max_dirs = ndirs / ngroups + inodes_per_group / 16; min_inodes = avefreei - inodes_per_group / 4; diff -puN fs/ext4/super.c~ext4-64-bit-divide-fix-fix fs/ext4/super.c --- a/fs/ext4/super.c~ext4-64-bit-divide-fix-fix +++ a/fs/ext4/super.c @@ -1485,7 +1485,7 @@ static int ext4_fill_super (struct super */ if (blocksize != EXT4_MIN_BLOCK_SIZE) { logic_sb_block = sb_block * EXT4_MIN_BLOCK_SIZE; - offset = do_div((u64)logic_sb_block, blocksize); + offset = do_div(logic_sb_block, blocksize); } else { logic_sb_block = sb_block; } @@ -1591,7 +1591,7 @@ static int ext4_fill_super (struct super brelse (bh); sb_set_blocksize(sb, blocksize); logic_sb_block = sb_block * EXT4_MIN_BLOCK_SIZE; - offset = do_div((u64)logic_sb_block, blocksize); + offset = do_div(logic_sb_block, blocksize); bh = sb_bread(sb, logic_sb_block); if (!bh) { printk(KERN_ERR _