Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp397760pxb; Thu, 26 Aug 2021 05:54:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4Lx+4IIlW63BwuE1twCWatcUilptzvAltlLK0dCQtbtQw1xran7xDhvwBngFsgzFicF9z X-Received: by 2002:a5d:974f:: with SMTP id c15mr2771858ioo.190.1629982486203; Thu, 26 Aug 2021 05:54:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629982486; cv=none; d=google.com; s=arc-20160816; b=MG793oKyEzFPvH4ZkeOGowLIoqdMoSHFvLlvDW4TyyLva3GTJZR2+5keKBMdgFWCc1 MVoydDAmur50PYCs8uI9rc9zFpeczal8BWa3YF0NfzWUtNlIofms/VatHdayXhj1me36 qdJRDfT6u8/wCLgAj3Gqa6CahZdw9WQssVOuaPzApF2cye/YUPU/Vb1PK3bYgXe0M+Dm vgZW0c/SUYGT11gQCNzJ+nxCq1abVe8DuTDFelpw6J3eyEdL9+rmMVWNoC5rpmUg0nNC RdSUaBnZYgL4lKUP/jH/CLBVlUkscOFENTdRxDbl/9HCPEZcv4N7q6n9TzhGccfxaieq vosQ== 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=JhDLl8oYXRQB7LggHxNh8Zf93uOKjNvdq0+mEtzOGTkj39X6UZ8xkMzZALf/qNCiXH 1lsHeamnt/cMOicDiEVqxaY768MIqRIJJP8EVdjfkG9K+KTDGkph4wxQa5UbuMw4HNM5 J0nVRpRN/NQOoantxuKSwlRm2VNp9c2W18q0eH6ip/3A3QV+LnlevUV/j4qBpEHtkfK1 9H0hYnmRd4Nqjfuqteum5PyJzbdZ16/78Go+vJalaBbiJ1zUpa+umOZ2sPENNFQXwd7G 6y66XSjXpuLrIbZxicjSK/EhEldMOBWeOTPaux2aMv8FX3Ts1ykS9GEWpvZdlVO0hh4w MaGQ== 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 f18si2556910iox.32.2021.08.26.05.54.27; Thu, 26 Aug 2021 05:54:46 -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 S242598AbhHZMys (ORCPT + 99 others); Thu, 26 Aug 2021 08:54:48 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:14423 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241694AbhHZMys (ORCPT ); Thu, 26 Aug 2021 08:54:48 -0400 Received: from dggeme752-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4GwN3h1WyczbdBc; Thu, 26 Aug 2021 20:50:08 +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.2308.8; Thu, 26 Aug 2021 20:53:58 +0800 From: Zhang Yi To: CC: , , , , Subject: [PATCH v4 1/6] ext4: move inode eio simulation behind io completeion Date: Thu, 26 Aug 2021 21:04:07 +0800 Message-ID: <20210826130412.3921207-2-yi.zhang@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210826130412.3921207-1-yi.zhang@huawei.com> References: <20210826130412.3921207-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: dggems705-chm.china.huawei.com (10.3.19.182) 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