mirror of
https://github.com/versity/scoutfs.git
synced 2026-07-25 09:33:15 +00:00
7d7f8e45b77ce91f3cdd0f7d9b012fe22ce2130e
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>
Description
No description provided
6.9 MiB
Languages
C
86.3%
Shell
10%
Roff
2.5%
TeX
0.8%
Makefile
0.4%