]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: lru: fix the standalone test case for invalid revision
authorWilly Tarreau <w@1wt.eu>
Sun, 7 Apr 2024 16:27:06 +0000 (18:27 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 13 Apr 2024 06:43:12 +0000 (08:43 +0200)
In 2.6, a build issue for LRU in standalone test mode was addressed by
commit bf9c07fd9 ("BUILD/DEBUG: lru: update the standalone code to
support the revision"), but using revision 1 while looking up rev 0
results in 100% misses. Let's fix this and commit with revision 0 as
well.

No backport is needed, this only happens when hacking on the code.

src/lru.c

index 07ef50c431b4ca9b4e56e5f5383a4cd638e597b7..bdc232a19cd2b794701b6b05b4ebeb74a1e0a528 100644 (file)
--- a/src/lru.c
+++ b/src/lru.c
@@ -258,7 +258,7 @@ static long get_value(struct lru64_head *lru, long a)
        /* do the painful work here */
        a = sum(a);
        if (item)
-               lru64_commit(item, (void *)a, lru, 1, 0);
+               lru64_commit(item, (void *)a, lru, 0, 0);
        return a;
 }