Commit 16175039 authored by John Stultz's avatar John Stultz Committed by Theodore Ts'o

ext4: fix abs() usage in ext4_mb_check_group_pa

The ext4_fsblk_t type is a long long, which should not be used
with abs(), as is done in ext4_mb_check_group_pa().

This patch modifies ext4_mb_check_group_pa() to use abs64()
instead.
Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent 1e381f60
...@@ -3333,8 +3333,8 @@ ext4_mb_check_group_pa(ext4_fsblk_t goal_block, ...@@ -3333,8 +3333,8 @@ ext4_mb_check_group_pa(ext4_fsblk_t goal_block,
atomic_inc(&pa->pa_count); atomic_inc(&pa->pa_count);
return pa; return pa;
} }
cur_distance = abs(goal_block - cpa->pa_pstart); cur_distance = abs64(goal_block - cpa->pa_pstart);
new_distance = abs(goal_block - pa->pa_pstart); new_distance = abs64(goal_block - pa->pa_pstart);
if (cur_distance <= new_distance) if (cur_distance <= new_distance)
return cpa; return cpa;
......
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