cluster: RHEL4 - Fix hang due to gfs_log_dump.

Bob Peterson rpeterso@fedoraproject.org
Fri Apr 17 13:29:00 GMT 2009


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=2b5c4941357d0904babbdf4548b2466c7d6f9dc4
Commit:        2b5c4941357d0904babbdf4548b2466c7d6f9dc4
Parent:        6cc6d11249bac6ff21839b96cd924655892d68ee
Author:        Bob Peterson <rpeterso@redhat.com>
AuthorDate:    Wed Apr 15 13:22:21 2009 -0500
Committer:     Bob Peterson <rpeterso@redhat.com>
CommitterDate: Wed Apr 15 13:22:21 2009 -0500

Fix hang due to gfs_log_dump.

bz 495514

Since function gfs_log_dump can call gfs_log_reserve,
which can in turn call gfs_log_flush, we need to call it
outside of the relatively new sd_log_flush_lock.
---
 gfs-kernel/src/gfs/log.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/gfs-kernel/src/gfs/log.c b/gfs-kernel/src/gfs/log.c
index a79e154..63ad8c0 100644
--- a/gfs-kernel/src/gfs/log.c
+++ b/gfs-kernel/src/gfs/log.c
@@ -1031,11 +1031,6 @@ log_flush_internal(struct gfs_sbd *sdp, struct gfs_glock *gl)
 		sdp->sd_vfs->s_dirt = FALSE;
 
 	gfs_log_unlock(sdp);
-
-	/*  Dump if we need to.  */
-
-	if (test_bit(SDF_NEED_LOG_DUMP, &sdp->sd_flags))
-		gfs_log_dump(sdp, FALSE);
 }
 
 /**
@@ -1050,6 +1045,11 @@ gfs_log_flush(struct gfs_sbd *sdp)
 	down(&sdp->sd_log_flush_lock); /* unlocked in gfs_sync_buf */
 	log_flush_internal(sdp, NULL);
 	up(&sdp->sd_log_flush_lock); /* locked in log_flush_internal */
+
+	/*  Dump if we need to.  */
+
+	if (test_bit(SDF_NEED_LOG_DUMP, &sdp->sd_flags))
+		gfs_log_dump(sdp, FALSE);
 }
 
 /**
@@ -1140,6 +1140,11 @@ gfs_log_flush_glock(struct gfs_glock *gl, int flags)
 	if (flags)
 		gfs_sync_buf(gl, flags | DIO_CHECK);
 	up(&sdp->sd_log_flush_lock);
+
+	/*  Dump if we need to.  */
+
+	if (test_bit(SDF_NEED_LOG_DUMP, &sdp->sd_flags))
+		gfs_log_dump(sdp, FALSE);
 }
 
 /**



More information about the Cluster-cvs mailing list