simoop: rework the verification code

This makes a few changes to simoop's verifier and general IO patterns.

First we have a few new options:

-v -- verify files immediately after writing them
-I -- ignore crcs completely
-e -- truncate all files to zero length on startup

We're now using sync_file_range to force file writes down to disk and
fadvise to drop caches before reads.

Header checks output more information about which offsets in the file
were corrupted, and also verify the inode number in the file matches the
inode number we expect.  I'll have to rework this if we start exercising
reflink'd extents but for now it helps detect misplaced writes.

All of these changes make simoop more useful for finding memory
corruptions and file data corruptions.

Signed-off-by: Chris Mason <clm@fb.com>
1 file changed
tree: 85e983c9a6d4d202996b470b06ba538c8d76cbce
  1. Makefile
  2. simoop.c
  3. xxhash.c
  4. xxhash.h