Zach Brown 7d7f8e45b7 scoutfs: more carefully manage private bh bits
The management of _checked and _valid_crc private bits in the
buffer_head wasn't quite right.

_checked indicates that the block has been checked and that the
expensive crc verification doesn't need to be recalculated.  _valid_crc
then indicates the result of the crc verification.

_checked is read without locks.  First, we didn't make sure that
_valid_crc was stored before _checked.  Multiple tasks could race to see
_checked before _valid_crc.  So we add some memory barriers.

Then we didn't clear _checked when re-reading a stale block.  This meant
that the moment the block was read its private flags could still
indicate that it had a valid crc.  We clear the private bits before we
read so that we'll recalculate the crc.

Signed-off-by: Zach Brown <zab@versity.com>
2018-04-27 09:06:35 -07:00
Description
No description provided
8 MiB
Languages
C 87%
Shell 9.3%
Roff 2.5%
TeX 0.8%
Makefile 0.4%