aboutsummaryrefslogtreecommitdiff
path: root/lib/test_fortify/write_overflow-memset.c
diff options
context:
space:
mode:
authorJohannes Weiner <[email protected]>2023-10-06 12:00:24 -0400
committerAndrew Morton <[email protected]>2023-10-18 12:12:40 -0700
commit969d63e1af3b3abe35a49b08218f3125131ac32f (patch)
tree9795ec5405ccfeeec191bdfc7689caa9d30e567e /lib/test_fortify/write_overflow-memset.c
parent229e2253766c7cdfe024f1fe280020cc4711087c (diff)
mm: zswap: fix pool refcount bug around shrink_worker()
When a zswap store fails due to the limit, it acquires a pool reference and queues the shrinker. When the shrinker runs, it drops the reference. However, there can be multiple store attempts before the shrinker wakes up and runs once. This results in reference leaks and eventual saturation warnings for the pool refcount. Fix this by dropping the reference again when the shrinker is already queued. This ensures one reference per shrinker run. Link: https://lkml.kernel.org/r/[email protected] Fixes: 45190f01dd40 ("mm/zswap.c: add allocation hysteresis if pool limit is hit") Signed-off-by: Johannes Weiner <[email protected]> Reported-by: Chris Mason <[email protected]> Acked-by: Nhat Pham <[email protected]> Cc: Vitaly Wool <[email protected]> Cc: Domenico Cerasuolo <[email protected]> Cc: <[email protected]> [5.6+] Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-memset.c')
0 files changed, 0 insertions, 0 deletions