git: 9front

Download patch

ref: 7e1dc861194c79a94f8fa92d5819b4ac479d0d4a
parent: dfb8d83c44195a8b97c06d6920b3fb8c4ed6cd19
author: Alex Musolino <alex@musolino.id.au>
date: Wed Dec 12 07:48:53 EST 2018

upas/fs: fix infinite loop in putcache

Force the cacheclear operation in the LRU cache trimming loop in order
to guarantee that the cache becomes smaller with each iteration.

Without the force flag cacheclear is a no-op for mailboxes that do not
provide a fetch function, e.g. POP3.

--- a/sys/src/cmd/upas/fs/cache.c
+++ b/sys/src/cmd/upas/fs/cache.c
@@ -100,7 +100,7 @@
 				return;
 			addlru(mb, mb->lru);
 		}
-		cachefree(mb, mb->lru, 0);
+		cachefree(mb, mb->lru, 1);
 	}
 }
 
--