]> git.ipfire.org Git - thirdparty/squid.git/commit
Fixed Rock MapDir read and write locking:
authorAlex Rousskov <rousskov@measurement-factory.com>
Wed, 2 Feb 2011 19:05:25 +0000 (12:05 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Wed, 2 Feb 2011 19:05:25 +0000 (12:05 -0700)
commit1adea2a655e4479e2682f5ae157dd19686f6153c
tree6c6e2a0384aa8dacc787182cac55948e16641a0d
parent14911a4e01015b5b559b25fad08f2185d46c7190
Fixed Rock MapDir read and write locking:

The IoState object created by openStoreIO() can be used for many reads. Thus,
incrementing read level at open and decrementing it at [each] readCompleted
leads to negative read levels if the stored object need more than one I/O.

Moreover, the only way core Squid can swap in an entry is if an entry has our
fileno set (by our get()). Thus, the slot is already locked for reading by
get(), with the entry responsible for decreasing the read level upon
destruction. We do not need to open/close for reading in
openStoreIO/readComleted.

When writing fails, invalidate the slot before unlocking it.
src/fs/rock/RockSwapDir.cc