]> git.ipfire.org Git - thirdparty/squid.git/commit
Fixed blocking reads that were sometimes reading from random file offsets. take04
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 22 Feb 2011 23:13:13 +0000 (16:13 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 22 Feb 2011 23:13:13 +0000 (16:13 -0700)
commit034b5ea4e50c77e0e390a4f379cc16b1ac5ab4d6
tree5969ad5ba8215861adc3ca0ca8d4aee95e89fe3d
parent7d3be4edda708c67daaee39587467ff3dd8b7a24
Fixed blocking reads that were sometimes reading from random file offsets.

Core "disk file" reading code assumed that if the globally stored disk.offset
matches the desired offset, there is no reason to seek. This was probably done
to reduce seek overhead between consecutive reads. Unfortunately, the disk
writing code did not know about that optimization and left F->disk.offset
unchanged after writing.

This may have worked OK for UFS if it never writes to the file it reads from,
but it does not work for store modules that do both kinds of I/O at different
offsets of the same disk file.

TODO: Implement this optimization correctly or remove disk.offset.
src/disk.cc