aboutsummaryrefslogtreecommitdiff
path: root/fs/f2fs/data.c
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2016-09-18 23:30:07 +0800
committerMister Oyster <oysterized@gmail.com>2017-04-13 12:34:07 +0200
commitf8f49dc46c3d55b877c5480ccb7c4e65d6d2d6c0 (patch)
tree1fe26dc2cd206da23326308a36b8b07ff8af7b2c /fs/f2fs/data.c
parent0fcb13819a3634c9a59240daaeabcaadef46ba7f (diff)
f2fs: support IO error injection
This patch adds to support IO error injection for testing IO error tolerance of f2fs. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/data.c')
-rw-r--r--fs/f2fs/data.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 680590c88..426983284 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -35,6 +35,11 @@ static void f2fs_read_end_io(struct bio *bio, int err)
struct bio_vec *bvec;
int i;
+#ifdef CONFIG_F2FS_FAULT_INJECTION
+ if (time_to_inject(FAULT_IO))
+ err = -EIO;
+#endif
+
if (f2fs_bio_encrypted(bio)) {
if (err) {
fscrypt_release_ctx(bio->bi_private);