f2fs: inject fault in inc_valid_node_count
authorChao Yu <yuchao0@huawei.com>
Mon, 13 Nov 2017 09:32:40 +0000 (17:32 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 19 Dec 2017 03:39:14 +0000 (19:39 -0800)
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>
fs/f2fs/f2fs.h

index 44f874483ecf4d4ab08c1e36f0c16d4d3b2b031a..ca6b0c9bc62175296ee6f8b3e5ba4aaf74ebc9aa 100644 (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;