Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp318714pxb; Wed, 18 Aug 2021 23:47:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSer/+r1fpqSijSBkbcYI1QYgDYQkL8FZXOpxtBuT96qoR0eUKN4aa1h0p7941VfZEhD0F X-Received: by 2002:a05:6602:2ac7:: with SMTP id m7mr10437366iov.66.1629355619993; Wed, 18 Aug 2021 23:46:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629355619; cv=none; d=google.com; s=arc-20160816; b=AYYRnuLwMfsioFHn/zQVnYkYNhnPikhQBf753DGSYRsUYjm3fVzdD0KhDq+q9ZFE7j IZmofbFjeuL6W0/tAndJ12/4+M8S5cWy9XfULvmx9SwmTsqhggaTBO4X8qCnbMm69by6 AYOoAwFBFoh36vtBzhWOkh5D6bP9i/RbGA/ciJ/9e844jdYjivg/a17/5A6PwCdQslOb 04aaCHwrQNGgViAZJqxO41ERph9zKm96592uTXAnEtnX0a+UhGcQF57zcoJa6DouNl/N 8Mzh78HpoHfpw9IQhdGNfrsuGrw52CVLHWjQmWHoULQW7Giu/1T5IdfvuMpiGQqIT3Iv 6fig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=xY9fRhAPr3yhcizbiKHR/xDR6nKnzYOQwaw6QwVq9eo=; b=Yo4BM6t/GxUsUvpr6TTvCtsF7ysrMCF0254OLZFf7KSPoy8y7lEuxmGoToi0FojNE+ 5WFRvbTBkg2+RHU9ngWjBtxMroNNQNqvGaIrWy7tRdJU8+4VLA+1mXBrUolMngycuY1h nQpFKqMOzkr3VihLiFnzOC607fW6koFjGeRHQf9ZnjycRdxrVVDKn+o/Av8mpiLttaKA t9D5/zMulNk5A+AmwjFVGdPLImjV7rxgdZTKeb3dIIriDQWcjqWxb1iLllRgrGKXeYoQ VpRYPT5k1lLYTn2rRQiqm8mJWTMSXzXkXT8lpOnwF3Wnqi3+AyzdjpnW7oFk2QA/U4zD 0mRQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b16si2086393ior.73.2021.08.18.23.46.42; Wed, 18 Aug 2021 23:46:59 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231220AbhHSGrN (ORCPT + 99 others); Thu, 19 Aug 2021 02:47:13 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:14275 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231234AbhHSGrN (ORCPT ); Thu, 19 Aug 2021 02:47:13 -0400 Received: from dggeme752-chm.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4GqwKG38fNz84wg; Thu, 19 Aug 2021 14:46:26 +0800 (CST) Received: from huawei.com (10.175.127.227) by dggeme752-chm.china.huawei.com (10.3.19.98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Thu, 19 Aug 2021 14:46:34 +0800 From: Zhang Yi To: CC: , , , , Subject: [PATCH v2 1/4] ext4: move inode eio simulation behind io completeion Date: Thu, 19 Aug 2021 14:57:01 +0800 Message-ID: <20210819065704.1248402-2-yi.zhang@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210819065704.1248402-1-yi.zhang@huawei.com> References: <20210819065704.1248402-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.127.227] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggeme752-chm.china.huawei.com (10.3.19.98) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org No EIO simulation is required if the buffer is uptodate, so move the simulation behind read bio completeion just like inode/block bitmap simulation does. Signed-off-by: Zhang Yi Reviewed-by: Jan Kara --- 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 d8de607849df..eb2526a35254 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -4330,8 +4330,6 @@ static int __ext4_get_inode_loc(struct super_block *sb, unsigned long ino, 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); @@ -4418,8 +4416,8 @@ static int __ext4_get_inode_loc(struct super_block *sb, unsigned long ino, ext4_read_bh_nowait(bh, REQ_META | REQ_PRIO, NULL); blk_finish_plug(&plug); wait_on_buffer(bh); + ext4_simulate_fail_bh(sb, bh, EXT4_SIM_INODE_EIO); if (!buffer_uptodate(bh)) { - simulate_eio: if (ret_block) *ret_block = block; brelse(bh); -- 2.31.1