dm flakey: add ability to specify the corrupting value to be written
Add additional corrupting value argument to corrupt_bio_byte feature.
A value of either 0 or 1 will be written to the specified byte in the
bio. Allowing other arbitrary corrupting values didn't seem necessary.
- /* write 0 to the specified Nth byte of the bio */
+ /* write to the specified Nth byte of the bio */
if (data && bio_bytes >= fc->corrupt_bio_byte) {
- data[fc->corrupt_bio_byte-1] = 0;
- printk("corrupting data rw=%lu
", bio_data_dir(bio));
+ data[fc->corrupt_bio_byte-1] = fc->corrupt_bio_value;
+
+ printk("corrupting data bio=%p by writing %u to byte %u "
+ "(rw=%lu flags=%lu bi_sector=%lu cur_bytes=%u)
",
+ bio, fc->corrupt_bio_value, fc->corrupt_bio_byte,
+ bio_data_dir(bio), bio->bi_rw, bio->bi_sector, bio_bytes);
}
}