fsx: don't skip file size and buf updates on simulated ops
fsx supports the ability to skip through a certain number of
operations of a given command sequence before beginning full
operation. The way this works is by tracking the operation count,
simulating minimal side effects of skipped operations in-memory, and
then finally writing out the in-memory state to the target file when
full operation begins.
Several fallocate() related operations don't correctly track
in-memory state when simulated, however. For example, consider an
ops file with the following two operations:
zero_range 0x0 0x1000 0x0
read 0x0 0x1000 0x0
... and an fsx run like so:
fsx -d -b 2 --replay-ops=<opsfile> <file>
This simulates the zero_range operation, but fails to track the file
extension that occurs as a side effect such that the subsequent read
doesn't occur as expected:
Will begin at operation 2
skipping zero size read
The read is skipped in this case because the file size is zero. The
proper behavior, and what is consistent with other size changing
operations, is to make the appropriate in-core changes before
checking whether an operation is simulated so the end result of
those changes can be reflected on-disk for eventual non-simulated
operations. This results in expected behavior with the same ops file
and test command:
Will begin at operation 2
2 read 0x0 thru 0xfff (0x1000 bytes)
Update zero, copy and clone range to do the file size and EOF change
related zeroing before checking against the simulated ops count.
Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Zorro Lang <zlang@kernel.org>