]> git.lizzy.rs Git - plan9front.git/commitdiff
upas/fs: fix infinite loop in putcache
authorAlex Musolino <alex@musolino.id.au>
Wed, 12 Dec 2018 02:18:53 +0000 (12:48 +1030)
committerAlex Musolino <alex@musolino.id.au>
Wed, 12 Dec 2018 02:18:53 +0000 (12:48 +1030)
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.

sys/src/cmd/upas/fs/cache.c

index 2328859dc868c8a0c8bd35896202d4ff3e4145f9..5382d08b0e2351085fd9498bc8ed2669880ad30e 100644 (file)
@@ -100,7 +100,7 @@ putcache(Mailbox *mb, Message *m)
                                return;
                        addlru(mb, mb->lru);
                }
-               cachefree(mb, mb->lru, 0);
+               cachefree(mb, mb->lru, 1);
        }
 }