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: the tag gfs2_0_1_52 has been created


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=990f3df3c820e369becbae354c9b06937e607853
Commit:        990f3df3c820e369becbae354c9b06937e607853
Parent:        c3d21611f050fc5d35f46c091d5844787ad79db5
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:56:58 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 710ded0..b43d335 100644
--- a/gfs2/libgfs2/buf.c
+++ b/gfs2/libgfs2/buf.c
@@ -60,7 +60,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 6285b7f..3d614e2 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -901,7 +901,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;
 }
 
@@ -923,7 +923,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;
 }
 
@@ -1429,7 +1429,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]