diff options
author | Chao Yu <yuchao0@huawei.com> | 2016-09-18 23:30:07 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-09-22 11:43:06 -0700 |
commit | 8b038c70dfe4fd7b62573917a9e976f826ac6ad3 (patch) | |
tree | 175fe3a2f6b72002259feb601f0de64b77de20f1 /fs/f2fs/f2fs.h | |
parent | 866969668aebe9626c083b9ababc8f88454ce049 (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/f2fs.h')
-rw-r--r-- | fs/f2fs/f2fs.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 951b9b3bc5f3..f28b3f8fa72b 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -46,6 +46,7 @@ enum { FAULT_BLOCK, FAULT_DIR_DEPTH, FAULT_EVICT_INODE, + FAULT_IO, FAULT_MAX, }; @@ -77,6 +78,8 @@ static inline bool time_to_inject(int type) return false; else if (type == FAULT_EVICT_INODE && !IS_FAULT_SET(type)) return false; + else if (type == FAULT_IO && !IS_FAULT_SET(type)) + return false; atomic_inc(&f2fs_fault.inject_ops); if (atomic_read(&f2fs_fault.inject_ops) >= f2fs_fault.inject_rate) { |