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>
This commit is contained in:
@@ -34,6 +34,11 @@ static void f2fs_read_end_io(struct bio *bio)
|
||||
struct bio_vec *bvec;
|
||||
int i;
|
||||
|
||||
#ifdef CONFIG_F2FS_FAULT_INJECTION
|
||||
if (time_to_inject(FAULT_IO))
|
||||
bio->bi_error = -EIO;
|
||||
#endif
|
||||
|
||||
if (f2fs_bio_encrypted(bio)) {
|
||||
if (bio->bi_error) {
|
||||
fscrypt_release_ctx(bio->bi_private);
|
||||
|
Reference in New Issue
Block a user