Skip to contentSkip to conversation

Fix bug where lock not held

PATCH New Steven Whitehouse 1 participant 1 message Oct 12, 2006 GFS2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 4/7 Fix bug where lock not held

Quoted 1 line

From fe1a698ffef5af546dd4a8cd6a1f2f202491c4ef Mon Sep 17 00:00:00 2001

From: Steven Whitehouse <[email protected]>
Date: Wed, 11 Oct 2006 13:34:59 -0400
Subject: [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.

---
 fs/gfs2/log.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
fs/gfs2/log.c +2 -3
index 554fe5b..72eec65 100644
@@ -569,16 +569,15 @@ void gfs2_log_flush(struct gfs2_sbd *sdp
 	else if (sdp->sd_log_tail != current_tail(sdp) && !sdp->sd_log_idle)
 		log_write_header(sdp, 0, PULL);
 	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_reserved = 0;
 	sdp->sd_log_commited_buf = 0;
 	sdp->sd_log_num_hdrs = 0;
 	sdp->sd_log_commited_revoke = 0;
 
-	gfs2_log_lock(sdp);
 	if (!list_empty(&ai->ai_ail1_list)) {
 		list_add(&ai->ai_list, &sdp->sd_ail1_list);
 		ai = NULL;
Signature · 1 line
1.4.1