[Tux3] the first dleaf_chop in dleaf.c:main() crashes

Benjamin K. Stuhl benjamin.stuhl at colorado.edu
Tue Sep 9 13:01:29 PDT 2008


I get crashes in the first dleaf_chop() when running "make dleaftest"; the
following patch fixes them, but I'm not at all certain it's correct.

Is Tux3 looking for Signed-off-by's yet?

Either way,
Signed-Off-By: Benjamin K. Stuhl <benjamin.stuhl at colorado.edu>

diff -r ef31d85601b7 user/test/dleaf.c
--- a/user/test/dleaf.c	Tue Sep 09 12:02:44 2008 -0700
+++ b/user/test/dleaf.c	Tue Sep 09 13:55:14 2008 -0600
@@ -79,6 +79,7 @@
 	if (!leaf)
 		return -1;
 	*to_dleaf(leaf) = (struct dleaf){ .magic = 0x1eaf, .free = sizeof(struct
dleaf), .used = btree->sb->blocksize };
+	memset(leaf + sizeof(struct dleaf), 0, btree->sb->blocksize -
sizeof(struct dleaf));
 	return 0;
 }

@@ -167,6 +168,9 @@
 	struct entry *estop = entry - group->count;
 	unsigned extents = 0, start = 0, trunc = 0;
 	unsigned newgroups = leaf->groups;
+
+	if (entry == estop && group == gstop)
+		return 0;

 	while (1) {
 		unsigned count = entry->limit - start;


_______________________________________________
Tux3 mailing list
Tux3 at tux3.org
http://tux3.org/cgi-bin/mailman/listinfo/tux3



More information about the Tux3 mailing list