shithub: gefs

Download patch

ref: 11398465c52e4fed4e62451f7ad31290726f6754
parent: 774cde189143f2e337a495553d5fe2e70d55f1ea
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Jan 30 20:35:35 EST 2022

tree, fs: small cleanups

add a newline when we hit fid reuse bugs,
and free the path in freepath, rather
than separately.

--- a/fs.c
+++ b/fs.c
@@ -461,7 +461,7 @@
 	unlock(&fs->fidtablk);
 
 	if(o != nil){
-		fprint(2, "fid in use: %d == %d", o->fid, new);
+		fprint(2, "fid in use: %d == %d\n", o->fid, new);
 		abort();
 		free(n);
 		return nil;
--- a/tree.c
+++ b/tree.c
@@ -1064,6 +1064,7 @@
 		putblk(p->nl);
 		putblk(p->nr);
 	}
+	free(path);
 }
 
 /*
@@ -1189,13 +1190,11 @@
 	t->dirty = 1;
 	unlock(&t->lk);
 	freepath(t, path, npath);
-	free(path);
 	if(redo)
 		goto Again;
 	return 0;
 Error:
 	freepath(t, path, npath);
-	free(path);
 	return Efs;
 }