summaryrefslogtreecommitdiff
path: root/libbcachefs/util.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-06-27 15:58:48 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2022-06-27 15:58:48 -0400
commitbad0c8c50758b4447d529f61017c1a8c85976a3e (patch)
treec27806cdcab52e6697163daeca7b9e903fcd6f64 /libbcachefs/util.c
parent64ddfc9fc5628f27cdc1399a283452196a7e2dcc (diff)
Update bcachefs sources to 95ff72a6c1 fixup! mm: Centralize & improve oom reporting in show_mem.c
Diffstat (limited to 'libbcachefs/util.c')
-rw-r--r--libbcachefs/util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libbcachefs/util.c b/libbcachefs/util.c
index 85b8f3df..8ef4b591 100644
--- a/libbcachefs/util.c
+++ b/libbcachefs/util.c
@@ -145,9 +145,10 @@ static int __bch2_strtou64_h(const char *cp, u64 *res)
if (f_n > div_u64(U64_MAX, b))
return -ERANGE;
- if (v + (f_n * b) / f_d < v)
+ f_n = div_u64(f_n * b, f_d);
+ if (v + f_n < v)
return -ERANGE;
- v += (f_n * b) / f_d;
+ v += f_n;
*res = v;
return cp - start;