gfs2 filesystem and dlm development
 help / color / mirror / Atom feed
* [PATCH] gfs2: fix withdraw after SDF_JOURNAL_LIVE clearing
@ 2026-12-01  1:25 Andreas Gruenbacher
  2026-12-01  1:46 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Gruenbacher @ 2026-12-01  1:25 UTC (permalink / raw)
  To: gfs2; +Cc: Andreas Gruenbacher

Right now, we can end up with the following sequence of events: the log
is non-empty when __gfs2_log_flush() clears the SDF_JOURNAL_LIVE flag,
the filesystem is withdrawn, do_withdraw() doesn't wait for the log to
clear because it sees that the SDF_JOURNAL_LIVE flag isn't set, the
filesystem is unmounted, gfs2_put_super() doesn't wait for the log to
clear because it sees that the filesystem is already marked read-only,
and it destroys the filesystem caches while objects in those caches are
still active.

Fix that by waiting for the log to clear even when the SDF_JOURNAL_LIVE
flag is no longer set in do_withdraw().

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
---
 fs/gfs2/util.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/fs/gfs2/util.c b/fs/gfs2/util.c
index 529c3ec37a18..c20d84100b99 100644
--- a/fs/gfs2/util.c
+++ b/fs/gfs2/util.c
@@ -117,10 +117,6 @@ void gfs2_freeze_unlock(struct gfs2_sbd *sdp)
 static void do_withdraw(struct gfs2_sbd *sdp)
 {
 	down_write(&sdp->sd_log_flush_lock);
-	if (!test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)) {
-		up_write(&sdp->sd_log_flush_lock);
-		return;
-	}
 	clear_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags);
 	gfs2_ail_drain(sdp); /* frees all transactions */
 	up_write(&sdp->sd_log_flush_lock);
-- 
2.56.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-01  1:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01  1:25 [PATCH] gfs2: fix withdraw after SDF_JOURNAL_LIVE clearing Andreas Gruenbacher
2026-12-01  1:46 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox