public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: STABLE2 - mkfs.gfs2 hangs with many journals
@ 2008-12-10 21:00 Bob Peterson
  0 siblings, 0 replies; only message in thread
From: Bob Peterson @ 2008-12-10 21:00 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=bdecaafad2e703f7e69ea68dfbd140cd5561b5cb
Commit:        bdecaafad2e703f7e69ea68dfbd140cd5561b5cb
Parent:        20de5309f76fb035079cbaf5a940f8637bbbdf0c
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:59:38 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){


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-12-10 21:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-10 21:00 cluster: STABLE2 - mkfs.gfs2 hangs with many journals Bob Peterson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).