DM_TARGET_FLAKEY(4)

NAME
dm_target_flakey - Device-mapper flakey target

SYNOPSIS
To compile this driver into the kernel, place the following lines in your kernel configuration file:

device dm
device dm_target_flakey

Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5):

    dm_target_flakey_load="YES"

DESCRIPTION
The dm_target_flakey target for dm(4) provides periodic unreliable I/O behavior to simulate failing devices for testing purposes. “dmsetup create” takes the following list of parameters for the dm_target_flakey table.

<device_path> <offset> <up_interval> <down_interval> [<num_feature_parameters> [<feature_parameters>]]

The first four parameters are mandatory. dm_target_flakey is similar to dm_target_linear(4) except that dm_target_flakey has parameters for periodic unreliable I/O behavior.

<device_path> is a path to the underlying device. <offset> is the starting sector within the device. <up_interval> is the number of seconds device is available. <down_interval> is the number of seconds device returns errors. The device has periodic unreliable I/O behavior for <down_interval> seconds every other <up_interval> seconds starting from the time the table is loaded by dmsetup(8).

Optional <feature_parameters> are as follows. <num_feature_parameters> takes the number of parameters for <feature_parameters>. In other words <num_feature_parameters> is the number of parameters after this. If <feature_parameters> are not specified, all I/Os return error during <down_interval>.

“drop_writes” feature takes no additional parameters. All write I/Os are silently ignored.

[drop_writes]

“corrupt_bio_byte” feature takes four additional mandatory parameters. It replaces <Nth_byte> of the “struct buf” data whose direction is <direction> with <value> during <down_interval>.

[corrupt_bio_byte <Nth_byte> <direction> <value> <flags>]

<Nth_byte> is the offset of the “struct buf” data to replace. Counting starts at 1 to replace the first byte of the data. <direction> is either 'r' for reads or 'w' for writes. Using 'w' is imcompatible with “drop_writes” feature. <value> is the value to replace which must be between 0 and 255. <flags> makes dm_target_flakey perform the replacement only if “b_flags” field of “struct buf” has all the specified flags set.

SEE ALSO
dm(4), dmsetup(8)

HISTORY
The dm_target_flakey dm(4) target first appeared in DragonFly 4.3.

AUTHORS
Tomohiro Kusumi <tkusumi@netbsd.org>