]> www.infradead.org Git - linux-platform-drivers-x86.git/commitdiff
gfs2: bypass log flush if the journal is not live
authorBob Peterson <rpeterso@redhat.com>
Fri, 12 Mar 2021 13:47:47 +0000 (08:47 -0500)
committerAndreas Gruenbacher <agruenba@redhat.com>
Fri, 12 Mar 2021 14:52:48 +0000 (15:52 +0100)
Patch fe3e397668775 ("gfs2: Rework the log space allocation logic")
changed gfs2_log_flush to reserve a set of journal blocks in case no
transaction is active.  However, gfs2_log_flush also gets called in
cases where we don't have an active journal, for example, for spectator
mounts.  In that case, trying to reserve blocks would sleep forever, but
we want gfs2_log_flush to be a no-op instead.

Fixes: fe3e397668775 ("gfs2: Rework the log space allocation logic")
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/log.c

index 760af666576ccb26f82ad184d69addc028f41844..6410281546f924942dd6a3f734a357e8eadd300a 100644 (file)
@@ -1036,7 +1036,7 @@ repeat:
         * Do this check while holding the log_flush_lock to prevent new
         * buffers from being added to the ail via gfs2_pin()
         */
-       if (gfs2_withdrawn(sdp))
+       if (gfs2_withdrawn(sdp) || !test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags))
                goto out;
 
        /* Log might have been flushed while we waited for the flush lock */