mirror of
https://github.com/versity/scoutfs.git
synced 2026-09-02 22:27:10 +00:00
9c1b39340405234d0fa864b3071859c63e0efa0b
There were some mistakes in tracking offline blocks. Online and offline block counts are meant to only refer to actual data contents. Sparse blocks in an archived file shouldn't be counted as offline. But the code was marking unallocated blocks as offline. This could corrupt the offline block count if a release extended past i_size and marked the blocks in the mapping item as offline even though they're past i_size. We could have clamped the block walking to not go past i_size. But we still would have had the problem of having offline blocks track sparse blocks. Instead we can fix the problem by only marking blocks offline if they had allocated blocks. This means that sparse regions are never marked offline and will always read zeros. Now a release that extends past i_size will not do anything to the unallocated blocks in the mapping item past i_size and the offline block count will be consistent. (Also the 'modified' and 'dirty' booleans were redundant, we only need one of the two.) Signed-off-by: Zach Brown <zab@versity.com>
Description
No description provided
7.7 MiB
Languages
C
86.4%
Shell
10%
Roff
2.5%
TeX
0.8%
Makefile
0.3%