Zach BrownandZach Brown 9c1b393404 scoutfs: don't track offline sparse blocks
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>
2018-04-02 10:21:58 -07:00
S
Description
No description provided
7.7 MiB
Languages
C 86.4%
Shell 10%
Roff 2.5%
TeX 0.8%
Makefile 0.3%