gfs2: Bypass log flush if the journal is not live
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 gfs2: Bypass log flush if the journal is not live
Patch fe3e397668775 ("gfs2: Rework the log space allocation logic") changed the log flush logic such that it reserves a set of journal blocks for cases in which log_flush has no active transaction but still needs blocks for revokes. However, these blocks were still requested even if the journal is not active, for example, for spectator mounts. In fact, the log_flush should be bypassed entirely in these cases. This patch adds a check to gfs2_log_flush so the function is bypassed if the journal is not active.
Fixes fe3e397668775 ("gfs2: Rework the log space allocation logic")
Signed-off-by Bob Peterson <[email protected]>
--- fs/gfs2/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/gfs2/log.c +1 -1
@@ -1036,7 +1036,7 @@ void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl, u32 flags)* 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 */