Andreas Gruenbacher 7a1ad9d812 gfs2: Fix lru_count accounting
Currently, gfs2_scan_glock_lru() decrements lru_count when a glock is
moved onto the dispose list.  When such a glock is then stolen from the
dispose list while gfs2_dispose_glock_lru() doesn't hold the lru_lock,
lru_count will be decremented again, so the counter will eventually go
negative.

This bug has existed in one form or another since at least commit
97cc1025b1a91 ("GFS2: Kill two daemons with one patch").

Fix this by only decrementing lru_count when we actually remove a glock
and schedule for it to be unlocked and dropped.  We also don't need to
remove and then re-add glocks when we can just as well move them back
onto the lru_list when necessary.

In addition, return the number of glocks freed as we should, not the
number of glocks moved onto the dispose list.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
2024-04-24 19:46:38 +02:00
..
2024-01-10 09:36:40 -08:00
2024-04-09 18:35:57 +02:00
2024-01-10 10:17:23 -08:00
2024-04-24 19:46:38 +02:00
2023-08-02 09:13:09 -06:00
2024-01-10 09:36:40 -08:00
2024-01-10 09:36:40 -08:00
2023-11-07 11:54:17 -08:00
2023-11-07 11:54:17 -08:00