Skip to content

Commit 1617503

Browse files
johnstultz-worktytso
authored andcommitted
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: John Stultz <[email protected]> Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 1e381f6 commit 1617503

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/ext4/mballoc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3333,8 +3333,8 @@ ext4_mb_check_group_pa(ext4_fsblk_t goal_block,
33333333
atomic_inc(&pa->pa_count);
33343334
return pa;
33353335
}
3336-
cur_distance = abs(goal_block - cpa->pa_pstart);
3337-
new_distance = abs(goal_block - pa->pa_pstart);
3336+
cur_distance = abs64(goal_block - cpa->pa_pstart);
3337+
new_distance = abs64(goal_block - pa->pa_pstart);
33383338

33393339
if (cur_distance <= new_distance)
33403340
return cpa;

0 commit comments

Comments
 (0)