summaryrefslogtreecommitdiff
path: root/sys/src/cmd/upas
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2017-09-23 17:33:05 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2017-09-23 17:33:05 +0200
commitb8d4c6ff17bbfdf6619454bbdbd65612a6d7defb (patch)
treed17782eab2d7d63874919333d3017f4c96d6222b /sys/src/cmd/upas
parent546046b46bd920c9da13e46c87efa08ab0c85bfa (diff)
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.
Diffstat (limited to 'sys/src/cmd/upas')
-rw-r--r--sys/src/cmd/upas/fs/cache.c1
1 files changed, 1 insertions, 0 deletions
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;