Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp1691267ybs; Tue, 26 May 2020 00:56:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznyRqZwPg4zbP7wJhhMM8kMFIYGVMeHBqL406ZV31IbIyMz7VfOqkNS8ipJQmHoXROD8FX X-Received: by 2002:a05:6402:642:: with SMTP id u2mr17851524edx.59.1590479813701; Tue, 26 May 2020 00:56:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590479813; cv=none; d=google.com; s=arc-20160816; b=hl6TnyWfsxVNa8pgVVCEnyx5utzp6Ssu9/gsz2L9jGmG+M5iFDPw7lgASv0TgbdNM8 QVWRXPi5kLQIUNU2aHxqS2Vckwlch+LGYEWRT1wzPv0thY/TdgA3Vbhlr38TN3O5hiMg +7TGfidiiug1alCfRyChfpLW/psylSppHQJQ3hGQHic24Y7dPCKNCfBZjv96kE60IpbX pc3Gii19YrZ/U9st2ODipHJTIcz5VEpI2AziFAIaubwcKf9hDwk7mL1uc4cVRQaDNBgQ rnpz1fWnD2ClobfpSD1h//pawb3dqrn5UhN88r5ZdDLFRcL8unxNav0nCxPDxzy94mKn Evnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=GnUuJKy5Z0x2XfgYmsr7nyA4gF3qc5nkPcLYT4a/0pk=; b=kUHXfYm+9Iexn6NiQHkLXfDBCvMXvK1/vM818m8WuJ+HAtrJAe/j/g0DAFX/59hOfs gCYKpEyM0l/CYVAiPmShOZp2tcnSE0Z35mw+s2kFb4/6i9yjVqN0s3vcH1XBtT3l0AL9 B19hPNrZaoCdXWyC1LN8QFu8gbFFY1GhJjguYkex9ChrEm1bz+h9PQ/ehnjVQm5n5SRW vwLLbZJCY2gMHy+swb21rzeCBykih1BLOe5jN9NHpb5DJUYjj6QZKzYISVW5mWLpBBNl O41cxq1Ea29PJQDH2sDOJ7YFUjNWDlnzPrM8OgXRn/w1EBlsoEpldmVEkJmJEOHoc0QR x4TA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d11si538649eds.416.2020.05.26.00.56.30; Tue, 26 May 2020 00:56:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731286AbgEZHT1 (ORCPT + 99 others); Tue, 26 May 2020 03:19:27 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:51102 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731390AbgEZHTZ (ORCPT ); Tue, 26 May 2020 03:19:25 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id EE67C3D061007B2BE599; Tue, 26 May 2020 15:19:14 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.487.0; Tue, 26 May 2020 15:19:07 +0800 From: "zhangyi (F)" To: CC: , , , , Subject: [PATCH 01/10] ext4: move inode eio simulation behind io completeion Date: Tue, 26 May 2020 15:17:45 +0800 Message-ID: <20200526071754.33819-2-yi.zhang@huawei.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200526071754.33819-1-yi.zhang@huawei.com> References: <20200526071754.33819-1-yi.zhang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.124.28] X-CFilter-Loop: Reflected Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Current EIO simulation of reading inode from disk isn't accurate since it will not submit bio if the inode buffer is uptodate. Move this simulation behind read bio completeion just like inode/block bitmap EIO simulation does. Signed-off-by: zhangyi (F) --- fs/ext4/inode.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 2a4aae6acdcb..e0f7e824b3b9 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -4279,8 +4279,6 @@ static int __ext4_get_inode_loc(struct inode *inode, bh = sb_getblk(sb, block); if (unlikely(!bh)) return -ENOMEM; - if (ext4_simulate_fail(sb, EXT4_SIM_INODE_EIO)) - goto simulate_eio; if (!buffer_uptodate(bh)) { lock_buffer(bh); @@ -4378,8 +4376,8 @@ static int __ext4_get_inode_loc(struct inode *inode, submit_bh(REQ_OP_READ, REQ_META | REQ_PRIO, bh); blk_finish_plug(&plug); wait_on_buffer(bh); + ext4_simulate_fail_bh(sb, bh, EXT4_SIM_INODE_EIO); if (!buffer_uptodate(bh)) { - simulate_eio: ext4_error_inode_block(inode, block, EIO, "unable to read itable block"); brelse(bh); -- 2.21.3