shithub: gefs

Download patch

ref: 63bf338613dc47c4043a004d0816deab8d06ee2c
parent: d80d5c21b0894167ebecaa2b583fbddbb3800b92
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Dec 16 14:22:37 EST 2023

fs: only reclaim blocks if we're deleting the tree

that's embarrassing.

--- a/snap.c
+++ b/snap.c
@@ -308,8 +308,8 @@
 	assert(nm <= nelem(m));
 	flushdlcache(1);
 	btupsert(&fs->snap, m, nm);
-	reclaimblocks(t->gen, succ, t->pred);
 	if(deltree){
+		reclaimblocks(t->gen, succ, t->pred);
 		for(mnt = fs->mounts; mnt != nil; mnt = mnt->next){
 			if(mnt->root->gen == t->succ)
 				mnt->root->pred = t->pred;