]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gfs2: drain ail under sd_log_flush_lock
authorAndreas Gruenbacher <agruenba@redhat.com>
Wed, 1 Apr 2026 16:18:38 +0000 (18:18 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Tue, 7 Apr 2026 20:19:22 +0000 (22:19 +0200)
When a withdraw is carried out, call gfs2_ail_drain() under the
sdp->sd_log_flush_lock.  This isn't strictly necessary but should be easier to
read, and more robust against possible future bugs.

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

index 02603200846d6fa161ea3124557e37a7d1ee4324..83b8bb6446e57b5e44c5b82a98465ec60e759e58 100644 (file)
@@ -123,9 +123,8 @@ static void do_withdraw(struct gfs2_sbd *sdp)
                return;
        }
        clear_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags);
-       up_write(&sdp->sd_log_flush_lock);
-
        gfs2_ail_drain(sdp); /* frees all transactions */
+       up_write(&sdp->sd_log_flush_lock);
 
        wake_up(&sdp->sd_logd_waitq);
        wake_up(&sdp->sd_quota_wait);