Commit e80ac2ed authored by Carlos Maiolino's avatar Carlos Maiolino Committed by Treehugger Robot
Browse files

UPSTREAM: XFS: fix zoned gc threshold math for 32-bit arches



xfs_zoned_need_gc makes use of mult_frac() to calculate the threshold
for triggering the zoned garbage collector, but, turns out mult_frac()
doesn't properly work with 64-bit data types and this caused build
failures on some 32-bit architectures.

Fix this by essentially open coding mult_frac() in a 64-bit friendly
way.

Notice we don't need to bother with counters underflow here because
xfs_estimate_freecounter() will always return a positive value, as it
leverages percpu_counter_read_positive to read such counters.

Fixes: 845abeb1 ("xfs: add tunable threshold parameter for triggering zone GC")
Reported-by: default avatarkernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202504181233.F7D9Atra-lkp@intel.com/


Signed-off-by: default avatarCarlos Maiolino <cmaiolino@redhat.com>
Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarHans Holmberg <hans.holmberg@wdc.com>
Signed-off-by: default avatarCarlos Maiolino <cem@kernel.org>

Change-Id: I11e98b4d87c04300f84c0ab12f97f3a2add5ac67
(cherry picked from commit bd7c1933)
Signed-off-by: default avatarCarlos Llamas <cmllamas@google.com>
parent c8fe14d4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment