From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751391AbdKMJeI (ORCPT ); Mon, 13 Nov 2017 04:34:08 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:10470 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751174AbdKMJdz (ORCPT ); Mon, 13 Nov 2017 04:33:55 -0500 From: Chao Yu To: CC: , , , Chao Yu Subject: [PATCH 2/2] f2fs: inject fault in inc_valid_node_count Date: Mon, 13 Nov 2017 17:32:40 +0800 Message-ID: <20171113093240.47560-2-yuchao0@huawei.com> X-Mailer: git-send-email 2.15.0.55.gc2ece9dc4de6 In-Reply-To: <20171113093240.47560-1-yuchao0@huawei.com> References: <20171113093240.47560-1-yuchao0@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.120.216.130] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.5A0966EA.0030,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 45128a44aa0b63985e455ce040c790ea Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds missing fault injection in inc_valid_node_count. Signed-off-by: Chao Yu --- fs/f2fs/f2fs.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 5c379a8ea075..22b81bbb056f 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -1765,6 +1765,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; -- 2.15.0.55.gc2ece9dc4de6