Revert "gfs2: fix glock shrinker ref issues"
authorAndreas Gruenbacher <agruenba@redhat.com>
Thu, 28 Mar 2024 18:14:07 +0000 (19:14 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Tue, 9 Apr 2024 16:35:58 +0000 (18:35 +0200)
This reverts commit 62862485a4c3a52029fc30f4bdde9af04afdafc9.

Commit 62862485a4c3 tried to fix issues introduced by commit
228804a35caa ("gfs2: Make glock lru list scanning safer"), but like that
commit, it failed to account for the bias state_change() adds to the
glock reference count for locked glocks.  Revert commit 62862485a4c3 so
that we can fix commit 228804a35caa properly.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/glock.c

index ec1f8eb28950937988bc006569ba7937d4f02e6b..2882a42e88aaa60ede90f6d02566a90986a9b1d9 100644 (file)
@@ -2056,9 +2056,7 @@ static long gfs2_scan_glock_lru(int nr)
                if (!test_bit(GLF_LOCK, &gl->gl_flags)) {
                        if (!spin_trylock(&gl->gl_lockref.lock))
                                continue;
-                       if (gl->gl_lockref.count <= 1 &&
-                           (gl->gl_state == LM_ST_UNLOCKED ||
-                            demote_ok(gl))) {
+                       if (!gl->gl_lockref.count) {
                                list_move(&gl->gl_lru, &dispose);
                                atomic_dec(&lru_count);
                                freed++;