homed: fix min_free tracking in manager_rebalance_calculate()

min_free is supposed to track the minimum free space across all home
directories to scale the next rebalance interval. However, it was
incorrectly assigned h->rebalance_size (the home's current total
allocation) instead of new_free (the remaining allocatable space).

This caused the rebalance interval to be computed from allocation sizes
rather than free space, so a nearly-full home would not trigger the
shorter intervals it should, delaying response to low-space conditions.

Signed-off-by: dongshengyuan <dongshengyuan@uniontech.com>
This commit is contained in:
dongshengyuan
2026-06-22 22:06:05 +02:00
committed by Lennart Poettering
parent 33bb855f3a
commit 294458fd00
+1 -1
View File
@@ -1909,7 +1909,7 @@ static int manager_rebalance_calculate(Manager *m) {
/* Keep track of home directory with the least amount of space left: we want to schedule the
* next rebalance more quickly if this is low */
if (new_free < min_free)
min_free = h->rebalance_size;
min_free = new_free;
if (new_free > UINT64_MAX - h->rebalance_usage)
h->rebalance_goal = UINT64_MAX-1; /* maximum size */