1b9790952STomohiro Kusumi.\" Copyright (c) 2015 The DragonFly BSD Project. 2b9790952STomohiro Kusumi.\" All rights reserved. 3b9790952STomohiro Kusumi.\" 4b9790952STomohiro Kusumi.\" This code is derived from software contributed to The DragonFly BSD Project 5*b0a9540aSTomohiro Kusumi.\" by Tomohiro Kusumi <tkusumi@netbsd.org> 6b9790952STomohiro Kusumi.\" 7b9790952STomohiro Kusumi.\" Redistribution and use in source and binary forms, with or without 8b9790952STomohiro Kusumi.\" modification, are permitted provided that the following conditions 9b9790952STomohiro Kusumi.\" are met: 10b9790952STomohiro Kusumi.\" 1. Redistributions of source code must retain the above copyright 11b9790952STomohiro Kusumi.\" notice, this list of conditions and the following disclaimer. 12b9790952STomohiro Kusumi.\" 2. Redistributions in binary form must reproduce the above copyright 13b9790952STomohiro Kusumi.\" notice, this list of conditions and the following disclaimer in the 14b9790952STomohiro Kusumi.\" documentation and/or other materials provided with the distribution. 15b9790952STomohiro Kusumi.\" 16b9790952STomohiro Kusumi.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 17b9790952STomohiro Kusumi.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18b9790952STomohiro Kusumi.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19b9790952STomohiro Kusumi.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 20b9790952STomohiro Kusumi.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21b9790952STomohiro Kusumi.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22b9790952STomohiro Kusumi.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23b9790952STomohiro Kusumi.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24b9790952STomohiro Kusumi.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25b9790952STomohiro Kusumi.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26b9790952STomohiro Kusumi.\" POSSIBILITY OF SUCH DAMAGE. 27b9790952STomohiro Kusumi.Dd November 17, 2015 28b9790952STomohiro Kusumi.Dt DM_TARGET_FLAKEY 4 29b9790952STomohiro Kusumi.Os 30b9790952STomohiro Kusumi.Sh NAME 31b9790952STomohiro Kusumi.Nm dm_target_flakey 32b9790952STomohiro Kusumi.Nd Device-mapper flakey target 33b9790952STomohiro Kusumi.Sh SYNOPSIS 34b9790952STomohiro KusumiTo compile this driver into the kernel, 35b9790952STomohiro Kusumiplace the following lines in your 36b9790952STomohiro Kusumikernel configuration file: 37b9790952STomohiro Kusumi.Bd -ragged -offset indent 38b9790952STomohiro Kusumi.Cd "device dm" 39b9790952STomohiro Kusumi.Cd "device dm_target_flakey" 40b9790952STomohiro Kusumi.Ed 41b9790952STomohiro Kusumi.Pp 42b9790952STomohiro KusumiAlternatively, to load the driver as a 43b9790952STomohiro Kusumimodule at boot time, place the following line in 44b9790952STomohiro Kusumi.Xr loader.conf 5 : 45b9790952STomohiro Kusumi.Bd -literal -offset indent 46b9790952STomohiro Kusumidm_target_flakey_load="YES" 47b9790952STomohiro Kusumi.Ed 48b9790952STomohiro Kusumi.Sh DESCRIPTION 49b9790952STomohiro KusumiThe 50b9790952STomohiro Kusumi.Nm 51b9790952STomohiro Kusumitarget for 52b9790952STomohiro Kusumi.Xr dm 4 53b9790952STomohiro Kusumiprovides periodic unreliable I/O behavior to simulate failing devices for testing purposes. 54b9790952STomohiro Kusumi.Dq Nm dmsetup Cm create 55b9790952STomohiro Kusumitakes the following list of parameters for the 56b9790952STomohiro Kusumi.Nm 57b9790952STomohiro Kusumitable. 58b9790952STomohiro Kusumi.Bd -ragged -offset indent 59b9790952STomohiro Kusumi.Cd "<device_path> <offset> <up_interval> <down_interval> [<num_feature_parameters> [<feature_parameters>]]" 60b9790952STomohiro Kusumi.Ed 61b9790952STomohiro Kusumi.Pp 62b9790952STomohiro KusumiThe first four parameters are mandatory. 63b9790952STomohiro Kusumi.Nm 64b9790952STomohiro Kusumiis similar to 65b9790952STomohiro Kusumi.Xr dm_target_linear 4 66b9790952STomohiro Kusumiexcept that 67b9790952STomohiro Kusumi.Nm 68b9790952STomohiro Kusumihas parameters for periodic unreliable I/O behavior. 69b9790952STomohiro Kusumi.Pp 70b9790952STomohiro Kusumi<device_path> is a path to the underlying device. 71b9790952STomohiro Kusumi<offset> is the starting sector within the device. 72b9790952STomohiro Kusumi<up_interval> is the number of seconds device is available. 73b9790952STomohiro Kusumi<down_interval> is the number of seconds device returns errors. 74b9790952STomohiro KusumiThe device has periodic unreliable I/O behavior for <down_interval> 75b9790952STomohiro Kusumiseconds every other <up_interval> seconds starting from the time 76b9790952STomohiro Kusumithe table is loaded by 77b9790952STomohiro Kusumi.Xr dmsetup 8 . 78b9790952STomohiro Kusumi.Pp 79b9790952STomohiro KusumiOptional <feature_parameters> are as follows. 80b9790952STomohiro Kusumi<num_feature_parameters> takes the number of parameters for <feature_parameters>. 81b9790952STomohiro KusumiIn other words <num_feature_parameters> is the number of parameters after this. 82ca8d6047STomohiro KusumiIf <feature_parameters> are not specified, all I/Os return error during <down_interval>. 83b9790952STomohiro Kusumi.Pp 84b9790952STomohiro Kusumi.Dq Nm drop_writes 85b9790952STomohiro Kusumifeature takes no additional parameters. 86b9790952STomohiro KusumiAll write I/Os are silently ignored. 87b9790952STomohiro Kusumi.Bd -ragged -offset indent 88b9790952STomohiro Kusumi.Cd "[drop_writes]" 89b9790952STomohiro Kusumi.Ed 90b9790952STomohiro Kusumi.Pp 91b9790952STomohiro Kusumi.Dq Nm corrupt_bio_byte 92b9790952STomohiro Kusumifeature takes four additional mandatory parameters. 93b9790952STomohiro KusumiIt replaces <Nth_byte> of the 94b9790952STomohiro Kusumi.Dq Nm struct Cm buf 95b9790952STomohiro Kusumidata 96b9790952STomohiro Kusumiwhose direction is <direction> with <value> during <down_interval>. 97b9790952STomohiro Kusumi.Bd -ragged -offset indent 98b9790952STomohiro Kusumi.Cd "[corrupt_bio_byte <Nth_byte> <direction> <value> <flags>]" 99b9790952STomohiro Kusumi.Ed 100b9790952STomohiro Kusumi.Pp 101b9790952STomohiro Kusumi<Nth_byte> is the offset of the 102b9790952STomohiro Kusumi.Dq Nm struct Cm buf 103b9790952STomohiro Kusumidata to replace. Counting starts at 1 to replace the first byte of the data. 104b9790952STomohiro Kusumi<direction> is either 'r' for reads or 'w' for writes. Using 'w' is imcompatible with 105b9790952STomohiro Kusumi.Dq Nm drop_writes 106b9790952STomohiro Kusumifeature. 107b9790952STomohiro Kusumi<value> is the value to replace which must be between 0 and 255. 108b9790952STomohiro Kusumi<flags> makes 109b9790952STomohiro Kusumi.Nm 110b9790952STomohiro Kusumiperform the replacement only if 111b9790952STomohiro Kusumi.Dq Nm b_flags 112b9790952STomohiro Kusumifield of 113b9790952STomohiro Kusumi.Dq Nm struct Cm buf 114b9790952STomohiro Kusumihas all the specified flags set. 115b9790952STomohiro Kusumi.Sh SEE ALSO 116b9790952STomohiro Kusumi.Xr dm 4 , 117b9790952STomohiro Kusumi.Xr dmsetup 8 118b9790952STomohiro Kusumi.Sh HISTORY 119b9790952STomohiro KusumiThe 120b9790952STomohiro Kusumi.Nm 121b9790952STomohiro Kusumi.Xr dm 4 122b9790952STomohiro Kusumitarget first appeared in 123b9790952STomohiro Kusumi.Dx 4.3 . 124b9790952STomohiro Kusumi.Sh AUTHORS 125*b0a9540aSTomohiro Kusumi.An Tomohiro Kusumi Aq Mt tkusumi@netbsd.org 126