shithub: gefs

Download patch

ref: d6e60977d129809f42a876742b8bc254bc7ee483
parent: c680fb2b3a3a34519d6901cf3f7606f9cdaa874f
author: Ori Bernstein <[email protected]>
date: Mon Feb 19 22:46:28 EST 2024

snap: fix small disk space leak

the snap deadlist is special, and blocks should be added
to it regardless of the generation number.

--- a/snap.c
+++ b/snap.c
@@ -548,12 +548,12 @@
 	 * are the responsibility of the other chain; in this chain, we
 	 * leak it and let the last reference in the other chain clean up
 	 */
-	if(bp.gen <= t->base)
-		return;
 	if(t == &fs->snap)
 		dl = &fs->snapdl;
-	else
+	else if(bp.gen > t->base)
 		dl = getdl(t->gen, bp.gen);
+	else
+		return;
 	if(waserror()){
 		putdl(dl);
 		nexterror();