^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) =========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) dm-flakey
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) =========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) This target is the same as the linear target except that it exhibits
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) unreliable behaviour periodically. It's been found useful in simulating
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) failing devices for testing purposes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) Starting from the time the table is loaded, the device is available for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) <up interval> seconds, then exhibits unreliable behaviour for <down
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) interval> seconds, and then this cycle repeats.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) Also, consider using this in combination with the dm-delay target too,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) which can delay reads and writes and/or send them to different
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) underlying devices.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) Table parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) ----------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) <dev path> <offset> <up interval> <down interval> \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) [<num_features> [<feature arguments>]]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) Mandatory parameters:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) <dev path>:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) Full pathname to the underlying block-device, or a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) "major:minor" device-number.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) <offset>:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) Starting sector within the device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) <up interval>:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) Number of seconds device is available.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) <down interval>:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) Number of seconds device returns errors.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) Optional feature parameters:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) If no feature parameters are present, during the periods of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) unreliability, all I/O returns errors.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) drop_writes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) All write I/O is silently ignored.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) Read I/O is handled correctly.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) error_writes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) All write I/O is failed with an error signalled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) Read I/O is handled correctly.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) corrupt_bio_byte <Nth_byte> <direction> <value> <flags>:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) During <down interval>, replace <Nth_byte> of the data of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) each matching bio with <value>.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) <Nth_byte>:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) The offset of the byte to replace.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) Counting starts at 1, to replace the first byte.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) <direction>:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) Either 'r' to corrupt reads or 'w' to corrupt writes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) 'w' is incompatible with drop_writes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) <value>:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) The value (from 0-255) to write.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) <flags>:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) Perform the replacement only if bio->bi_opf has all the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) selected flags set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) Examples:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) Replaces the 32nd byte of READ bios with the value 1::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) corrupt_bio_byte 32 r 1 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) Replaces the 224th byte of REQ_META (=32) bios with the value 0::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) corrupt_bio_byte 224 w 0 32