Commit fe1a698f authored by Steven Whitehouse's avatar Steven Whitehouse

[GFS2] Fix bug where lock not held

The log lock needs to be held when manipulating the counter
for the number of free journal blocks.
Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
parent 1ee48af2
...@@ -569,16 +569,15 @@ void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl) ...@@ -569,16 +569,15 @@ void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl)
else if (sdp->sd_log_tail != current_tail(sdp) && !sdp->sd_log_idle) else if (sdp->sd_log_tail != current_tail(sdp) && !sdp->sd_log_idle)
log_write_header(sdp, 0, PULL); log_write_header(sdp, 0, PULL);
lops_after_commit(sdp, ai); lops_after_commit(sdp, ai);
sdp->sd_log_head = sdp->sd_log_flush_head;
gfs2_log_lock(sdp);
sdp->sd_log_head = sdp->sd_log_flush_head;
sdp->sd_log_blks_free -= sdp->sd_log_num_hdrs; sdp->sd_log_blks_free -= sdp->sd_log_num_hdrs;
sdp->sd_log_blks_reserved = 0; sdp->sd_log_blks_reserved = 0;
sdp->sd_log_commited_buf = 0; sdp->sd_log_commited_buf = 0;
sdp->sd_log_num_hdrs = 0; sdp->sd_log_num_hdrs = 0;
sdp->sd_log_commited_revoke = 0; sdp->sd_log_commited_revoke = 0;
gfs2_log_lock(sdp);
if (!list_empty(&ai->ai_ail1_list)) { if (!list_empty(&ai->ai_ail1_list)) {
list_add(&ai->ai_list, &sdp->sd_ail1_list); list_add(&ai->ai_list, &sdp->sd_ail1_list);
ai = NULL; ai = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment