Commit b6aeffc5 authored by Chengguang Xu's avatar Chengguang Xu Committed by Jan Kara

ext2: code cleanup for ext2_free_blocks()

Call ext2_data_block_valid() for block range validity.
Signed-off-by: default avatarChengguang Xu <cgxu519@zoho.com.cn>
Link: https://lore.kernel.org/r/20190723112155.20329-2-cgxu519@zoho.com.cnSigned-off-by: default avatarJan Kara <jack@suse.cz>
parent e5d39597
......@@ -490,9 +490,7 @@ void ext2_free_blocks (struct inode * inode, unsigned long block,
struct ext2_super_block * es = sbi->s_es;
unsigned freed = 0, group_freed;
if (block < le32_to_cpu(es->s_first_data_block) ||
block + count < block ||
block + count > le32_to_cpu(es->s_blocks_count)) {
if (!ext2_data_block_valid(sbi, block, count)) {
ext2_error (sb, "ext2_free_blocks",
"Freeing blocks not in datazone - "
"block = %lu, count = %lu", block, count);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment