]> git.ipfire.org Git - thirdparty/squid.git/commit - src/StoreSwapLogData.cc
Bug 3441: Part 1: Minimize cache size corruption by malformed swap.state.
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 30 Jan 2012 17:13:52 +0000 (10:13 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Mon, 30 Jan 2012 17:13:52 +0000 (10:13 -0700)
commit3f9d4dc21bce9043c3ded0607a36a7883995b44d
treeade610709d553624caf9c0750adf60749cea2ff6
parent5a04da20f3435478115202628c872672ea4898c1
Bug 3441: Part 1: Minimize cache size corruption by malformed swap.state.

If swap.state gets corrupted, a single entry with bogus size value will screw
up Squid idea of the current cache size. A newly added StoreSwapLogData sane()
method attempts to minimize the chance of corruption by ignoring log entries
with obviously bogus values.

However, without expensive size checks (-S or "Does the log entry matches the
actual cache file size?"), it is not possible to reliably detect all bogus log
entries.

If Squid gets a wrong idea of the current cache size, it may either cache too
much (and possibly run out of space) OR delete everything.
src/StoreSwapLogData.cc
src/StoreSwapLogData.h
src/cache_diff.cc
src/fs/ufs/ufscommon.cc