[PATCH 01/12] GFS2: Fix debugfs glock file iterator

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Steven Whitehouse
Date: Friday, September 26, 2008 - 5:00 am

Due to an incorrect iterator, some glocks were being missed from the
glock dumps obtained via debugfs. This patch fixes the problem and
ensures that we don't miss any glocks in future.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 13391e5..4cbb695 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -1816,15 +1816,17 @@ restart:
 	if (gl) {
 		gi->gl = hlist_entry(gl->gl_list.next,
 				     struct gfs2_glock, gl_list);
-		if (gi->gl)
-			gfs2_glock_hold(gi->gl);
+	} else {
+		gi->gl = hlist_entry(gl_hash_table[gi->hash].hb_list.first,
+				     struct gfs2_glock, gl_list);
 	}
+	if (gi->gl)
+		gfs2_glock_hold(gi->gl);
 	read_unlock(gl_lock_addr(gi->hash));
 	if (gl)
 		gfs2_glock_put(gl);
-	if (gl && gi->gl == NULL)
-		gi->hash++;
 	while (gi->gl == NULL) {
+		gi->hash++;
 		if (gi->hash >= GFS2_GL_HASH_SIZE)
 			return 1;
 		read_lock(gl_lock_addr(gi->hash));
@@ -1833,7 +1835,6 @@ restart:
 		if (gi->gl)
 			gfs2_glock_hold(gi->gl);
 		read_unlock(gl_lock_addr(gi->hash));
-		gi->hash++;
 	}
 
 	if (gi->sdp != gi->gl->gl_sbd)
-- 
1.5.5.1

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
GFS2: Pre-pull patch posting, Steven Whitehouse, (Fri Sep 26, 5:00 am)
[PATCH 01/12] GFS2: Fix debugfs glock file iterator, Steven Whitehouse, (Fri Sep 26, 5:00 am)
[PATCH 02/12] GFS2: Fix metafs mounts, Steven Whitehouse, (Fri Sep 26, 5:00 am)
[PATCH 03/12] GFS2: rm on multiple nodes causes panic, Steven Whitehouse, (Fri Sep 26, 5:00 am)
[PATCH 04/12] GFS2: Fix &amp; clean up GFS2 rename, Steven Whitehouse, (Fri Sep 26, 5:00 am)
[PATCH 05/12] GFS2: Fix race relating to glock min-hold time, Steven Whitehouse, (Fri Sep 26, 5:00 am)
[PATCH 06/12] GFS2: Use an IS_ERR test rather than a NULL test, Steven Whitehouse, (Fri Sep 26, 5:00 am)
[PATCH 07/12] GFS2: Direct IO write at end of file error, Steven Whitehouse, (Fri Sep 26, 5:00 am)
[PATCH 08/12] GFS2: GFS2 will panic if you misspell any mo ..., Steven Whitehouse, (Fri Sep 26, 5:00 am)
[PATCH 09/12] GFS2: The war on bloat, Steven Whitehouse, (Fri Sep 26, 5:00 am)
[PATCH 10/12] GFS2: high time to take some time over atime, Steven Whitehouse, (Fri Sep 26, 5:00 am)
[PATCH 11/12] GFS2: Add UUID to GFS2 sb, Steven Whitehouse, (Fri Sep 26, 5:00 am)
[PATCH 12/12] GFS2: Support for I/O barriers, Steven Whitehouse, (Fri Sep 26, 5:00 am)