fsx: Add mechanism to replay failed operations
Create a $name.fsxops file next to $test.fsxlog. When a test fails,
dump the operations in the log into that file in a simple, parseable
format like:
fallocate 0x2e0f2 0xf04a 0x0 keep_size
truncate 0x0 0x11e00 0x0 *
write 0x73400 0x6c00 0x11e00
skip punch_hole 0x71539913 0xdf76 0x7a000 close_open
mapread 0x56000 0x16d08 0x7a000
Here, each operation is on a separate line. When the first word is
"skip", the operation will be skipped. The next parameters are offset,
length, and the current file size, followed by optional flags like
keep_size and clode_open. A trailing asterisk indicates that the
operation overlaps with the operation that has failed.
Add a --replay-ops option that allows to replay the operations recorded
in such a $name.fsxops file. (The log can be modified to easily narrow
down which operations are causing the failure.)
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>