From b8d4c6ff17bbfdf6619454bbdbd65612a6d7defb Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sat, 23 Sep 2017 17:33:05 +0200 Subject: upas/fs: fix putcache(), sub-part messages should never go into the lru we accidentally added non-top messages (attatchments) to the lru, resulting in attachments to be freed. this is wrong. --- sys/src/cmd/upas/fs/cache.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/src/cmd/upas/fs/cache.c b/sys/src/cmd/upas/fs/cache.c index 087b4de62..e0685650e 100644 --- a/sys/src/cmd/upas/fs/cache.c +++ b/sys/src/cmd/upas/fs/cache.c @@ -100,6 +100,7 @@ putcache(Mailbox *mb, Message *m) { int n; + while(!Topmsg(mb, m)) m = m->whole; addlru(mb, m); while(mb->lru != nil && (mb->cached > cachetarg || mb->nlru > 10)){ n = 0; -- cgit v1.2.3