]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
homed: fix min_free tracking in manager_rebalance_calculate()
authordongshengyuan <545258830@qq.com>
Mon, 22 Jun 2026 05:38:05 +0000 (13:38 +0800)
committerLennart Poettering <lennart@poettering.net>
Mon, 22 Jun 2026 20:06:05 +0000 (22:06 +0200)
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>
src/home/homed-manager.c

index bdee16d276839a8897eb276840fc265d501f397b..81b2e83763867b44b1d7b78d2baee372308f8d57 100644 (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 */