]> git.lizzy.rs Git - plan9front.git/commit
upas/fs: fix infinite loop in putcache (again)
authorAlex Musolino <alex@musolino.id.au>
Sun, 30 Dec 2018 13:30:09 +0000 (00:00 +1030)
committerAlex Musolino <alex@musolino.id.au>
Sun, 30 Dec 2018 13:30:09 +0000 (00:00 +1030)
commit2c6cc121339ade33ac5aa4b46356df1cd5469fbe
tree1f303eef93d15b674677997a640265663a34c671
parentf464b7ff16135fc4dddf30291dc5b7226651d2b3
upas/fs: fix infinite loop in putcache (again)

The previous attempt to fix this problem (see changesets b32199e0f90a
and 00ae79a6ba50) caused all calls to cachefree to free the cached
message contents in addition to updating the LRU list.  This causes
problems for the POP3 driver since it provides no fetch function; once
a message is evicted from the LRU cache, its contents is lost.

This time we fix cachefree to always update the LRU list but only free
the cached message contents if the driver provides a fetch function or
the force flag is set.
sys/src/cmd/upas/fs/cache.c
sys/src/cmd/upas/fs/dat.h
sys/src/cmd/upas/fs/mbox.c