Commit 7a1ad9d
Andreas Gruenbacher
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
97cc102 ("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>1 parent acf1f42 commit 7a1ad9d
1 file changed
Lines changed: 13 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2009 | 2009 | | |
2010 | 2010 | | |
2011 | 2011 | | |
2012 | | - | |
| 2012 | + | |
2013 | 2013 | | |
2014 | 2014 | | |
2015 | 2015 | | |
2016 | 2016 | | |
| 2017 | + | |
2017 | 2018 | | |
2018 | 2019 | | |
2019 | 2020 | | |
2020 | 2021 | | |
2021 | 2022 | | |
2022 | | - | |
2023 | | - | |
2024 | 2023 | | |
2025 | 2024 | | |
2026 | | - | |
2027 | | - | |
2028 | | - | |
| 2025 | + | |
2029 | 2026 | | |
2030 | 2027 | | |
2031 | 2028 | | |
2032 | 2029 | | |
2033 | 2030 | | |
2034 | 2031 | | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
2035 | 2036 | | |
2036 | 2037 | | |
2037 | 2038 | | |
2038 | 2039 | | |
2039 | 2040 | | |
2040 | 2041 | | |
2041 | 2042 | | |
| 2043 | + | |
2042 | 2044 | | |
2043 | 2045 | | |
2044 | 2046 | | |
| |||
2050 | 2052 | | |
2051 | 2053 | | |
2052 | 2054 | | |
2053 | | - | |
| 2055 | + | |
2054 | 2056 | | |
2055 | 2057 | | |
2056 | 2058 | | |
2057 | | - | |
| 2059 | + | |
2058 | 2060 | | |
2059 | 2061 | | |
2060 | 2062 | | |
2061 | | - | |
| 2063 | + | |
2062 | 2064 | | |
2063 | | - | |
| 2065 | + | |
2064 | 2066 | | |
2065 | | - | |
2066 | | - | |
2067 | | - | |
2068 | 2067 | | |
2069 | 2068 | | |
2070 | | - | |
| 2069 | + | |
2071 | 2070 | | |
2072 | 2071 | | |
2073 | 2072 | | |
| |||
0 commit comments