cgroup/misc: Store atomic64_t reads to u64

Change 'new_usage' type to u64 so it can be compared with unsigned 'max'
and 'capacity' properly even if the value crosses the signed boundary.

Signed-off-by: Haitao Huang <haitao.huang@linux.intel.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
Haitao Huang 2023-07-21 05:02:31 -07:00 committed by Tejun Heo
parent 32bf85c60c
commit 714e08cc3e
1 changed files with 1 additions and 1 deletions

View File

@ -142,7 +142,7 @@ int misc_cg_try_charge(enum misc_res_type type, struct misc_cg *cg, u64 amount)
struct misc_cg *i, *j;
int ret;
struct misc_res *res;
s64 new_usage;
u64 new_usage;
if (!(valid_type(type) && cg && READ_ONCE(misc_res_capacity[type])))
return -EINVAL;