diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2008-09-14 08:56:33 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-10-09 02:56:17 -0400 |
commit | 581d4e28d9195aa8b2231383dbabc288988d615e (patch) | |
tree | 093bcac9a538ef67edcf91826f7532bdb88e6248 /block/genhd.c | |
parent | 0a0d96b03a1f3bfd6bc3ea08008699e8e59fccd9 (diff) |
block: add fault injection mechanism for faking request timeouts
Only works for the generic request timer handling. Allows one to
sporadically ignore request completions, thus exercising the timeout
handling.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/genhd.c')
-rw-r--r-- | block/genhd.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/block/genhd.c b/block/genhd.c index 8acaff0154e3..4cd3433c99ac 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
@@ -817,6 +817,11 @@ static DEVICE_ATTR(stat, S_IRUGO, part_stat_show, NULL); | |||
817 | static struct device_attribute dev_attr_fail = | 817 | static struct device_attribute dev_attr_fail = |
818 | __ATTR(make-it-fail, S_IRUGO|S_IWUSR, part_fail_show, part_fail_store); | 818 | __ATTR(make-it-fail, S_IRUGO|S_IWUSR, part_fail_show, part_fail_store); |
819 | #endif | 819 | #endif |
820 | #ifdef CONFIG_FAIL_IO_TIMEOUT | ||
821 | static struct device_attribute dev_attr_fail_timeout = | ||
822 | __ATTR(io-timeout-fail, S_IRUGO|S_IWUSR, part_timeout_show, | ||
823 | part_timeout_store); | ||
824 | #endif | ||
820 | 825 | ||
821 | static struct attribute *disk_attrs[] = { | 826 | static struct attribute *disk_attrs[] = { |
822 | &dev_attr_range.attr, | 827 | &dev_attr_range.attr, |
@@ -829,6 +834,9 @@ static struct attribute *disk_attrs[] = { | |||
829 | #ifdef CONFIG_FAIL_MAKE_REQUEST | 834 | #ifdef CONFIG_FAIL_MAKE_REQUEST |
830 | &dev_attr_fail.attr, | 835 | &dev_attr_fail.attr, |
831 | #endif | 836 | #endif |
837 | #ifdef CONFIG_FAIL_IO_TIMEOUT | ||
838 | &dev_attr_fail_timeout.attr, | ||
839 | #endif | ||
832 | NULL | 840 | NULL |
833 | }; | 841 | }; |
834 | 842 | ||