aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/log.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-10-11 13:34:59 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-10-12 17:10:55 -0400
commitfe1a698ffef5af546dd4a8cd6a1f2f202491c4ef (patch)
tree6e4bcc487487e2b751e40ef5e531be08e8630419 /fs/gfs2/log.c
parent1ee48af22ed6dcddea8cdf93c7f2a268cbcf0d56 (diff)
[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: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/log.c')
-rw-r--r--fs/gfs2/log.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index 554fe5bd1b72..72eec6542d6a 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -569,16 +569,15 @@ void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl)
569 else if (sdp->sd_log_tail != current_tail(sdp) && !sdp->sd_log_idle) 569 else if (sdp->sd_log_tail != current_tail(sdp) && !sdp->sd_log_idle)
570 log_write_header(sdp, 0, PULL); 570 log_write_header(sdp, 0, PULL);
571 lops_after_commit(sdp, ai); 571 lops_after_commit(sdp, ai);
572 sdp->sd_log_head = sdp->sd_log_flush_head;
573 572
573 gfs2_log_lock(sdp);
574 sdp->sd_log_head = sdp->sd_log_flush_head;
574 sdp->sd_log_blks_free -= sdp->sd_log_num_hdrs; 575 sdp->sd_log_blks_free -= sdp->sd_log_num_hdrs;
575
576 sdp->sd_log_blks_reserved = 0; 576 sdp->sd_log_blks_reserved = 0;
577 sdp->sd_log_commited_buf = 0; 577 sdp->sd_log_commited_buf = 0;
578 sdp->sd_log_num_hdrs = 0; 578 sdp->sd_log_num_hdrs = 0;
579 sdp->sd_log_commited_revoke = 0; 579 sdp->sd_log_commited_revoke = 0;
580 580
581 gfs2_log_lock(sdp);
582 if (!list_empty(&ai->ai_ail1_list)) { 581 if (!list_empty(&ai->ai_ail1_list)) {
583 list_add(&ai->ai_list, &sdp->sd_ail1_list); 582 list_add(&ai->ai_list, &sdp->sd_ail1_list);
584 ai = NULL; 583 ai = NULL;