]> git.ipfire.org Git - thirdparty/squid.git/commit - src/store_swapout.cc
Author: Alex Rousskov <rousskov@measurement-factory.com>
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 3 Sep 2009 10:29:07 +0000 (22:29 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 3 Sep 2009 10:29:07 +0000 (22:29 +1200)
commit246e6cc1f2390938b13e496dd23956d1e1901295
tree0d6b54414a396af78e110ff36c1cb93ad360ba75
parentd2bf2f902f18d59143609d67910b164ee97874a1
Author: Alex Rousskov <rousskov@measurement-factory.com>
Fixed entry size calculation for the max-size cache_dir selection algorithms.

There were two sides of this bug:

In src/store_swapout.cc, we must create metadata earlier because
storeCreate() needs swap_hdr_sz. With swap_hdr_sz unknown at the time of
storeCreate(), the SwapDir selection algorithms may select SwapDirs that
should not really take the entry as the real storage size (with the
metadata swap_hdr_sz) would exceed the store slot size.

In src/store_dir.cc, we must add the metadata size before looking for
cache_dirs that accept objsize. Only the "new"
storeDirSelectSwapDirRoundRobin selection scheme was affected.
src/store_dir.cc
src/store_swapout.cc