Add "drop_writes", "corrupt_bio_byte" and "debug" features to the
flakey target. This work was motivated by a need to test the checksum
support of the new DM multisnapshot target.
I was able to successfully test multisnap checksums with the
following:
load a previously created multisnapshot pool that has a valid
multisnap metadata superblock, when reading write 1 to the 352rd byte
of the bio (352 happens to the offset to an unused compat_flags field
in 'struct multisnap_super_block; the change causes the multisnap crc
code to notice):
(NOTE: I need to cleanup the multisnapshot code so it doesn't throw
errors on the floor, checksum failure returns -EILSEQ not -ENOMEM)
The kernel log showed:
corrupting data bio=ffff88007c8d5140 by writing 1 to byte 352 (rw=0 flags=0 bi_sector=2056 cur_bytes=4096)
multisnap sb_check failed csum 4189028790 wanted 227629054
superblock validator check failed for block 0
couldn't lock superblock
tm_open_with_sm failed
device-mapper: table: 253:2: multisnap-pool: Error creating metadata object
device-mapper: ioctl: error adding target to table
Mike Snitzer (9):
dm: factor out target argument parsing helpers
dm flakey: use dm_target_offset() and support discards
dm flakey: start of adding features
dm flakey: add drop_writes feature
dm flakey: add corrupt_bio_byte feature
dm flakey: add corrupt_bio_byte read support
dm flakey: switch corrupt_bio_data_dir to corrupt_bio_flags
dm flakey: add ability to specify the corrupting value to be written
dm flakey: add debug feature to control debug output