Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp200896pxb; Fri, 20 Aug 2021 23:45:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpeW/QobiQd+xTMHvC9KdAUhh6GlEv7iG8tv5qalW9///r4JUv/2OlC4JSoPjstw8jn0au X-Received: by 2002:a05:6e02:6d2:: with SMTP id p18mr16259217ils.44.1629528312115; Fri, 20 Aug 2021 23:45:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629528312; cv=none; d=google.com; s=arc-20160816; b=SWqRTXyX471H0K6euoeAOvoNzYcgL6mX7bBw0IOQN2s1xITEngoYSW5FPb1TQQxeZb y5YoY/3lpsMl6bVbLZIskEqWOzQbC51W8DHmuNR103zKx6x+3aMglbdMc5A3irKRfk3I lv7ROnWgXb47oka2C6wE1Q0UrbMZED9PF3C+CKliXCPjq2ImTmMBpU9VQwQFf2TnK6TT 2drHI0I+zMD2MaU+oDC3DWnQ0sxgCvkxb6FadFFMM08TwTFfUK8Z0gK6k9nt380DZe0S Rf/wqfUKtj+k+E2Ry9/kreWLJnSUvhdHJzlRsVMvDsobWm9gBITNF1KZ2fRRzQgVn8oW coiA== 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=Qznb0Cvh6su4hN3unq72W4cOCn4IUJCNWKD2i5wDf1iuBMuG9tvpa1wloQBx4wWECC nE1dRlBsYUabKVYGi1tW1BtaaMYhaJbCHdCSPuyNQtZ6hov6fOsYpqkuJZ+JCPzhc/R8 9+X0GhRQKf75xlSe6RAzt0Jtk7fp7Rp4zjDcV1TCwwZcypHdCPW7IeWumdddoiTo4dqO Y2aFE1Ovwi+FdSKzvw2aGdJoZ9Ana4vy8E9P0b4JyVhlT9e86+KhrsEfoIpE9nXJ7V9x 2qtWQPAId07CqB9+0Hk2YzzDOj4TiqrrJWrJ2C/+rM/1278OfgMDicrrCtnYSu4cDaFu 6N6Q== 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 r17si9760039ilj.23.2021.08.20.23.44.33; Fri, 20 Aug 2021 23:45:12 -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 S231944AbhHUGpJ (ORCPT + 99 others); Sat, 21 Aug 2021 02:45:09 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:8917 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231666AbhHUGpI (ORCPT ); Sat, 21 Aug 2021 02:45:08 -0400 Received: from dggeme752-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Gs85L5bTSz8snw; Sat, 21 Aug 2021 14:40:22 +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; Sat, 21 Aug 2021 14:44:27 +0800 From: Zhang Yi To: CC: , , , , Subject: [PATCH v3 1/4] ext4: move inode eio simulation behind io completeion Date: Sat, 21 Aug 2021 14:54:47 +0800 Message-ID: <20210821065450.1397451-2-yi.zhang@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210821065450.1397451-1-yi.zhang@huawei.com> References: <20210821065450.1397451-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: dggems701-chm.china.huawei.com (10.3.19.178) 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