summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2017-11-13 17:32:40 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2017-11-13 20:21:35 -0800
commit812c60564ca721a2527ed069c9221ec348368fd7 (patch)
tree080df250727189d45aa2ab0feda4a8e268af69dc /fs
parent28cfafb73853f0494b06649716687a3ea07681d5 (diff)
downloadlinux-stable-812c60564ca721a2527ed069c9221ec348368fd7.tar.gz
linux-stable-812c60564ca721a2527ed069c9221ec348368fd7.tar.bz2
linux-stable-812c60564ca721a2527ed069c9221ec348368fd7.zip
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/f2fs.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 44f874483ecf..ca6b0c9bc621 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -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;