f2fs: inject fault in inc_valid_node_count

This patch adds missing fault injection in inc_valid_node_count.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Chao Yu 2017-11-13 17:32:40 +08:00 committed by Jaegeuk Kim
parent 28cfafb738
commit 812c60564c
1 changed files with 7 additions and 0 deletions

View File

@ -1770,6 +1770,13 @@ static inline int inc_valid_node_count(struct f2fs_sb_info *sbi,
return ret;
}
#ifdef CONFIG_F2FS_FAULT_INJECTION
if (time_to_inject(sbi, FAULT_BLOCK)) {
f2fs_show_injection_info(FAULT_BLOCK);
goto enospc;
}
#endif
spin_lock(&sbi->stat_lock);
valid_block_count = sbi->total_valid_block_count + 1;