Commit 9084d471 authored by Theodore Ts'o's avatar Theodore Ts'o

ext4: use ext4_data_block_valid() in ext4_free_blocks()

The block validity framework does a more comprehensive set of checks,
and it saves object code space to use the ext4_data_block_valid() than
the limited open-coded version that had been in ext4_free_blocks().
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent 1585d8d8
...@@ -4463,9 +4463,7 @@ void ext4_free_blocks(handle_t *handle, struct inode *inode, ...@@ -4463,9 +4463,7 @@ void ext4_free_blocks(handle_t *handle, struct inode *inode,
sbi = EXT4_SB(sb); sbi = EXT4_SB(sb);
es = EXT4_SB(sb)->s_es; es = EXT4_SB(sb)->s_es;
if (block < le32_to_cpu(es->s_first_data_block) || if (!ext4_data_block_valid(sbi, block, count)) {
block + count < block ||
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 = %llu, count = %lu", block, count); "block = %llu, 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