Skip to contentSkip to conversation

GFS2: Clear dirty bit at end of inode glock sync

Cluster-devel Steven Whitehouse 1 participant 2 messages Apr 20, 2009 GFS2 file system

lore
Share & tools
lore
#0 lore raw

From 5e60bcaa263dac8a3df4334459414bcb0808009f Mon Sep 17 00:00:00 2001
From: Steven Whitehouse <[email protected]>
Date: Mon, 20 Apr 2009 08:58:45 +0100
Subject: [PATCH] GFS2: Clear dirty bit at end of inode glock sync

The dirty bit can get set during the inode glock sync. Its too complicated to change that at the moment, so this is the quick fix - to clear the bit again at the end of the function.

fs/gfs2/glops.c +6 -0
index bf23a62..70f87f4 100644
@@ -156,6 +156,12 @@ static void inode_go_sync(struct gfs2_glock *gl)
 	error = filemap_fdatawait(metamapping);
 	mapping_set_error(metamapping, error);
 	gfs2_ail_empty_gl(gl);
+	/*
+	 * Writeback of the data mapping may cause the dirty flag to be set
+	 * so we have to clear it again here.
+	 */
+	smp_mb__before_clear_bit();
+	clear_bit(GLF_DIRTY, &gl->gl_flags);
 }
 
 /**
Signature · 1 line
1.6.0.6
#1 lore raw

Hi,

I should also add that this patch has gone into the -fixes tree as well and I'm intending to push it to Linus fairly shortly,

Steve.

Quoted 28 lines · Steven Whitehouse
Quoted 1 line

From 5e60bcaa263dac8a3df4334459414bcb0808009f Mon Sep 17 00:00:00 2001

From: Steven Whitehouse <[email protected]>
Date: Mon, 20 Apr 2009 08:58:45 +0100
Subject: [PATCH] GFS2: Clear dirty bit at end of inode glock sync

The dirty bit can get set during the inode glock sync. Its too complicated to change that at the moment, so this is the quick fix - to clear the bit again at the end of the function.

fs/gfs2/glops.c +6 -0
index bf23a62..70f87f4 100644
@@ -156,6 +156,12 @@ static void inode_go_sync(struct gfs2_glock *gl)
 	error = filemap_fdatawait(metamapping);
 	mapping_set_error(metamapping, error);
 	gfs2_ail_empty_gl(gl);
+	/*
+	 * Writeback of the data mapping may cause the dirty flag to be set
+	 * so we have to clear it again here.
+	 */
+	smp_mb__before_clear_bit();
+	clear_bit(GLF_DIRTY, &gl->gl_flags);
 }
 
 /**