Skip to content

Commit 655531c

Browse files
author
Andreas Gruenbacher
committed
Revert "gfs2: fix infinite loop when checking ail item count before go_inval"
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 33dbd1e ("gfs2: fix infinite loop when checking ail item count before go_inval"). Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
1 parent af572ef commit 655531c

2 files changed

Lines changed: 4 additions & 16 deletions

File tree

fs/gfs2/glock.c

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -678,23 +678,8 @@ __acquires(&gl->gl_lockref.lock)
678678
goto skip_inval;
679679
}
680680

681-
if (target == LM_ST_UNLOCKED || target == LM_ST_DEFERRED) {
682-
/*
683-
* The call to go_sync should have cleared out the ail list.
684-
* If there are still items, we have a problem. We ought to
685-
* withdraw, but we can't because the withdraw code also uses
686-
* glocks. Warn about the error, dump the glock, then fall
687-
* through and wait for logd to do the withdraw for us.
688-
*/
689-
if ((atomic_read(&gl->gl_ail_count) != 0) &&
690-
(!cmpxchg(&sdp->sd_log_error, 0, -EIO))) {
691-
gfs2_glock_assert_warn(gl,
692-
!atomic_read(&gl->gl_ail_count));
693-
gfs2_dump_glock(NULL, gl, true);
694-
gfs2_withdraw(sdp);
695-
}
681+
if (target == LM_ST_UNLOCKED || target == LM_ST_DEFERRED)
696682
glops->go_inval(gl, target == LM_ST_DEFERRED ? 0 : DIO_METADATA);
697-
}
698683
spin_lock(&gl->gl_lockref.lock);
699684

700685
skip_inval:

fs/gfs2/glops.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ static void rgrp_go_inval(struct gfs2_glock *gl, int flags)
232232
end = PAGE_ALIGN((rgd->rd_addr + rgd->rd_length) * bsize) - 1;
233233
gfs2_rgrp_brelse(rgd);
234234
WARN_ON_ONCE(!(flags & DIO_METADATA));
235+
gfs2_assert_withdraw(sdp, !atomic_read(&gl->gl_ail_count));
235236
truncate_inode_pages_range(mapping, start, end);
236237
}
237238

@@ -358,6 +359,8 @@ static void inode_go_inval(struct gfs2_glock *gl, int flags)
358359
{
359360
struct gfs2_inode *ip = gfs2_glock2inode(gl);
360361

362+
gfs2_assert_withdraw(gl->gl_name.ln_sbd, !atomic_read(&gl->gl_ail_count));
363+
361364
if (flags & DIO_METADATA) {
362365
struct address_space *mapping = gfs2_glock2aspace(gl);
363366
truncate_inode_pages(mapping, 0);

0 commit comments

Comments
 (0)