Commit 36f0af4f authored by Feiko Nanninga's avatar Feiko Nanninga Committed by Kent Overstreet

bcachefs: Fix sysfs rebalance duration waited formatting

cat /sys/fs/bcachefs/*/internal/rebalance_status
waiting
  io wait duration:  13.5 GiB
  io wait remaining: 627 MiB
  duration waited:   1392 m

duration waited was increasing at a rate of about 14 times the expected
rate.

div_u64 takes a u32 divisor, but u->nsecs (from time_units[]) can be
bigger than u32.
Signed-off-by: default avatarFeiko Nanninga <feiko.nanninga@fnanninga.de>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent a3ed1cc4
...@@ -360,7 +360,7 @@ void bch2_pr_time_units(struct printbuf *out, u64 ns) ...@@ -360,7 +360,7 @@ void bch2_pr_time_units(struct printbuf *out, u64 ns)
{ {
const struct time_unit *u = bch2_pick_time_units(ns); const struct time_unit *u = bch2_pick_time_units(ns);
prt_printf(out, "%llu %s", div_u64(ns, u->nsecs), u->name); prt_printf(out, "%llu %s", div64_u64(ns, u->nsecs), u->name);
} }
static void bch2_pr_time_units_aligned(struct printbuf *out, u64 ns) static void bch2_pr_time_units_aligned(struct printbuf *out, u64 ns)
......
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