Skip to content

Commit

Permalink
ext4: fix abs() usage in ext4_mb_check_group_pa
Browse files Browse the repository at this point in the history
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: John Stultz <john.stultz@linaro.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
  • Loading branch information
John Stultz authored and Theodore Ts'o committed Oct 19, 2015
1 parent 1e381f6 commit 1617503
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/ext4/mballoc.c
Original file line number Diff line number Diff line change
@@ -3333,8 +3333,8 @@ ext4_mb_check_group_pa(ext4_fsblk_t goal_block,
atomic_inc(&pa->pa_count);
return pa;
}
cur_distance = abs(goal_block - cpa->pa_pstart);
new_distance = abs(goal_block - pa->pa_pstart);
cur_distance = abs64(goal_block - cpa->pa_pstart);
new_distance = abs64(goal_block - pa->pa_pstart);

if (cur_distance <= new_distance)
return cpa;

0 comments on commit 1617503

Please sign in to comment.