提交 0610b6e9 编写于 作者: T Theodore Ts'o

ext4: Fix 64-bit block type problem on 32-bit platforms

The function ext4_mb_free_blocks() was using an "unsigned long" to
pass a block number; this will cause 64-bit block numbers to get
truncated on x86 and other 32-bit platforms.
Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: NEric Sandeen <sandeen@redhat.com>
上级 11013911
...@@ -1341,7 +1341,7 @@ extern void ext4_discard_preallocations(struct inode *); ...@@ -1341,7 +1341,7 @@ extern void ext4_discard_preallocations(struct inode *);
extern int __init init_ext4_mballoc(void); extern int __init init_ext4_mballoc(void);
extern void exit_ext4_mballoc(void); extern void exit_ext4_mballoc(void);
extern void ext4_mb_free_blocks(handle_t *, struct inode *, extern void ext4_mb_free_blocks(handle_t *, struct inode *,
unsigned long, unsigned long, int, unsigned long *); ext4_fsblk_t, unsigned long, int, unsigned long *);
extern int ext4_mb_add_groupinfo(struct super_block *sb, extern int ext4_mb_add_groupinfo(struct super_block *sb,
ext4_group_t i, struct ext4_group_desc *desc); ext4_group_t i, struct ext4_group_desc *desc);
extern void ext4_mb_update_group_info(struct ext4_group_info *grp, extern void ext4_mb_update_group_info(struct ext4_group_info *grp,
......
...@@ -4689,7 +4689,7 @@ ext4_mb_free_metadata(handle_t *handle, struct ext4_buddy *e4b, ...@@ -4689,7 +4689,7 @@ ext4_mb_free_metadata(handle_t *handle, struct ext4_buddy *e4b,
* Main entry point into mballoc to free blocks * Main entry point into mballoc to free blocks
*/ */
void ext4_mb_free_blocks(handle_t *handle, struct inode *inode, void ext4_mb_free_blocks(handle_t *handle, struct inode *inode,
unsigned long block, unsigned long count, ext4_fsblk_t block, unsigned long count,
int metadata, unsigned long *freed) int metadata, unsigned long *freed)
{ {
struct buffer_head *bitmap_bh = NULL; struct buffer_head *bitmap_bh = NULL;
...@@ -4715,11 +4715,11 @@ void ext4_mb_free_blocks(handle_t *handle, struct inode *inode, ...@@ -4715,11 +4715,11 @@ void ext4_mb_free_blocks(handle_t *handle, struct inode *inode,
block + count > ext4_blocks_count(es)) { block + count > ext4_blocks_count(es)) {
ext4_error(sb, __func__, ext4_error(sb, __func__,
"Freeing blocks not in datazone - " "Freeing blocks not in datazone - "
"block = %lu, count = %lu", block, count); "block = %llu, count = %lu", block, count);
goto error_return; goto error_return;
} }
ext4_debug("freeing block %lu\n", block); ext4_debug("freeing block %llu\n", block);
trace_ext4_free_blocks(inode, block, count, metadata); trace_ext4_free_blocks(inode, block, count, metadata);
ac = kmem_cache_alloc(ext4_ac_cachep, GFP_NOFS); ac = kmem_cache_alloc(ext4_ac_cachep, GFP_NOFS);
...@@ -4761,7 +4761,7 @@ void ext4_mb_free_blocks(handle_t *handle, struct inode *inode, ...@@ -4761,7 +4761,7 @@ void ext4_mb_free_blocks(handle_t *handle, struct inode *inode,
ext4_error(sb, __func__, ext4_error(sb, __func__,
"Freeing blocks in system zone - " "Freeing blocks in system zone - "
"Block = %lu, count = %lu", block, count); "Block = %llu, count = %lu", block, count);
/* err = 0. ext4_std_error should be a no op */ /* err = 0. ext4_std_error should be a no op */
goto error_return; goto error_return;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册