This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cluster: RHEL53 - mkfs.gfs2 hangs with many journals


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=aec6b7ab5e50908303ca5c4f9542c25657cf05ce
Commit:        aec6b7ab5e50908303ca5c4f9542c25657cf05ce
Parent:        86bd22ba38127c3903fe70d6ba548bf475cc5922
Author:        Bob Peterson <rpeterso@redhat.com>
AuthorDate:    Wed Dec 10 14:16:21 2008 -0600
Committer:     Bob Peterson <rpeterso@redhat.com>
CommitterDate: Wed Dec 10 14:44:08 2008 -0600

mkfs.gfs2 hangs with many journals

bz 471618

This is the addendum 2 patch for bug #471618.  There are
two fixes: (1) switches the order back to normal (reverse)
when freeing buffers.  This ensures the oldest buffers are
freed before the more recent, which is what we want and
how it was originally.  (2) The get_first_leaf and
get_next_leaf code were making the faulty assumption that
the buffers they're searching will be in memory.  That may
not be the case, especially if the buffer order is incorrect
(as in fix (1)).
---
 gfs2/libgfs2/buf.c    |    3 ++-
 gfs2/libgfs2/fs_ops.c |    6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/gfs2/libgfs2/buf.c b/gfs2/libgfs2/buf.c
index b2c8e3a..fd50d45 100644
--- a/gfs2/libgfs2/buf.c
+++ b/gfs2/libgfs2/buf.c
@@ -73,7 +73,8 @@ add_buffer(struct buf_list *bl, struct gfs2_buffer_head *bh)
 		int found = 0;
 		osi_list_t *tmp, *x;
 
-		osi_list_foreach_safe(tmp, &bl->list, x) {
+		for (tmp = bl->list.prev, x = tmp->prev; tmp != &bl->list;
+		     tmp = x, x = x->prev) {
 			bh = osi_list_entry(tmp, struct gfs2_buffer_head,
 					    b_list);
 			if (!bh->b_count) {
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index 90049bd..7fe944b 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -914,7 +914,7 @@ static int get_first_leaf(struct gfs2_inode *dip, uint32_t index,
 	uint64_t leaf_no;
 
 	gfs2_get_leaf_nr(dip, index, &leaf_no);
-	*bh_out = bget(&dip->i_sbd->buf_list, leaf_no);
+	*bh_out = bread(&dip->i_sbd->buf_list, leaf_no);
 	return 0;
 }
 
@@ -936,7 +936,7 @@ static int get_next_leaf(struct gfs2_inode *dip,struct gfs2_buffer_head *bh_in,
 
 	if (!leaf->lf_next)
 		return -1;
-	*bh_out = bget(&dip->i_sbd->buf_list, be64_to_cpu(leaf->lf_next));
+	*bh_out = bread(&dip->i_sbd->buf_list, be64_to_cpu(leaf->lf_next));
 	return 0;
 }
 
@@ -1442,7 +1442,7 @@ static int dir_e_del(struct gfs2_inode *dip, const char *filename, int len)
 		gfs2_get_leaf_nr(dip, index, &leaf_no);
 
 		while(leaf_no && !found){
-			bh = bget(&dip->i_sbd->buf_list, leaf_no);
+			bh = bread(&dip->i_sbd->buf_list, leaf_no);
 			error = leaf_search(dip, bh, filename, len, &cur, &prev);
 			if (error) {
 				if(error != -ENOENT){


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]