]> Gentwo Git Trees - linux/.git/commitdiff
Revert "gfs2: fix infinite loop when checking ail item count before go_inval"
authorAndreas Gruenbacher <agruenba@redhat.com>
Sat, 9 Aug 2025 20:04:00 +0000 (22:04 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Wed, 26 Nov 2025 23:52:27 +0000 (23:52 +0000)
The current withdraw code duplicates the journal recovery code gfs2
already has for dealing with node failures, and it does so poorly.  That
code was added because when releasing a lockspace, we didn't have a way
to indicate that the lockspace needs recovery.  We now do have this
feature, so the current withdraw code can be removed almost entirely.
This is one of several steps towards that.

Reverts commit 33dbd1e41a1d ("gfs2: fix infinite loop when checking ail
item count before go_inval").

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

index d78535dd76f254ef97b274b8eba2ffe19372bf61..2f790fe90f3b3909dec32548b03e6a9d052db3d0 100644 (file)
@@ -678,23 +678,8 @@ __acquires(&gl->gl_lockref.lock)
                goto skip_inval;
        }
 
-       if (target == LM_ST_UNLOCKED || target == LM_ST_DEFERRED) {
-               /*
-                * The call to go_sync should have cleared out the ail list.
-                * If there are still items, we have a problem. We ought to
-                * withdraw, but we can't because the withdraw code also uses
-                * glocks. Warn about the error, dump the glock, then fall
-                * through and wait for logd to do the withdraw for us.
-                */
-               if ((atomic_read(&gl->gl_ail_count) != 0) &&
-                   (!cmpxchg(&sdp->sd_log_error, 0, -EIO))) {
-                       gfs2_glock_assert_warn(gl,
-                                              !atomic_read(&gl->gl_ail_count));
-                       gfs2_dump_glock(NULL, gl, true);
-                       gfs2_withdraw(sdp);
-               }
+       if (target == LM_ST_UNLOCKED || target == LM_ST_DEFERRED)
                glops->go_inval(gl, target == LM_ST_DEFERRED ? 0 : DIO_METADATA);
-       }
        spin_lock(&gl->gl_lockref.lock);
 
 skip_inval:
index 6714bd3f7facead60c9dd30552de5a70b35edf13..035269dabcc76cdb8e613acfadd5b34c0073097d 100644 (file)
@@ -232,6 +232,7 @@ static void rgrp_go_inval(struct gfs2_glock *gl, int flags)
        end = PAGE_ALIGN((rgd->rd_addr + rgd->rd_length) * bsize) - 1;
        gfs2_rgrp_brelse(rgd);
        WARN_ON_ONCE(!(flags & DIO_METADATA));
+       gfs2_assert_withdraw(sdp, !atomic_read(&gl->gl_ail_count));
        truncate_inode_pages_range(mapping, start, end);
 }
 
@@ -358,6 +359,8 @@ static void inode_go_inval(struct gfs2_glock *gl, int flags)
 {
        struct gfs2_inode *ip = gfs2_glock2inode(gl);
 
+       gfs2_assert_withdraw(gl->gl_name.ln_sbd, !atomic_read(&gl->gl_ail_count));
+
        if (flags & DIO_METADATA) {
                struct address_space *mapping = gfs2_glock2aspace(gl);
                truncate_inode_pages(mapping, 0);