A read of a clean block which was still running when the same data was
overwritten and flushed could fail with a false -EDOM in two cases:
- The flush moved the object to a new block (redirect-write). The metadata
entry of the old block is zeroed out, in memory too, so the read verified
its data against zero bitmap and checksums. Only the new location was
marked as changed in used_clean_objects.
- csum_block_size == bitmap_granularity and the same blocks were overwritten
in place. The read verified old data against new checksums, because this
branch never skipped verification.
Mark the old location as changed too, and do not verify clean data in the
second branch if its location was changed during the read. Reads which start
during a flush are still verified there, because they take the overwritten
blocks from the journal.
used_clean_obj_t::was_changed was set by a flush (or by a read started
during one) and never reset while the entry had references, so a read
started after the flush had finished, but while an older read still held
the same clean block, also returned data without verifying checksums.
Count flushes in the entry instead and remember the count at the start
of each read, skipping verification only if it changed or a flush was
already running.