Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp112569pxk; Thu, 24 Sep 2020 00:33:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUD0YRsNRnIChbi7QLTkp+oxgzyjdBc1/221gPfWE7Vq+3JtG9pcRyRvDJgnLghJ21d55O X-Received: by 2002:a17:906:b47:: with SMTP id v7mr3164235ejg.310.1600932805571; Thu, 24 Sep 2020 00:33:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600932805; cv=none; d=google.com; s=arc-20160816; b=PfB99V6MsCwSzL7DOUoyJuXI2zFHk0ow2Z9aSS4I8piEG6GZKVaW1fxQ7AqiW7RwkQ xRY+QzAbM9pPZryC6osHsrb8R7GhqWnWotDXH4eR9ARsu2qs2lO6TFCFlu2Gh1vBBJkq kb/de09175NUNfTAD7mqoZPeMTkVEq9Qk34N9LW3/SKNUCpLoPtBZLNwSoUoz6Pi2whi 8hGIdtrGFtF+fNifsFT9h0U8kwbmB4hUODSTgLkjoKq88W0Icp1QM/BbLDwkQPP8Rmt1 i0IRAopqG4MTM5X+jInhvV5KxP5SSp/9s+FZ+lhFZf8nLAgTSz5buLKlPPuU6l11WgEq CaGg== 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=JqZbKF2EanVD4Y/EQf6zVSgsqMfYc+rZPnxKJ/mS6rQ=; b=tRxKAdaQVen69HiTzu5feRTy3MOwi/Z3uQ0Qj8NL9i/84xQltJEVrS3+3lyGazRpgj zrLKK7u1AEV9lHRts8YFafv//COqyNDP9tS1Qu74u4KUUSb0ePSgpzK5BAa+YIzugjX5 rtZPaci4E7gt+elH9tPwKe32PrVUNmkK7J/i3QKTeyTjHJIwtu3l0XuHLWvXM72YVHBP L6P4Wz15teZTZH+l0hu4Rs4qNQpp1kBLdF8y60eoFgeb5UTK83mZJmyFdKhmOX6ywkI9 nRoC45hoP03T24n2wiRcnpj0zOlvB2GyDTRV5scp/jDG10YntQgyFsojR4zHABuetBQ5 EHuw== 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 b43si1728500edf.15.2020.09.24.00.32.53; Thu, 24 Sep 2020 00:33:25 -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 S1727132AbgIXHct (ORCPT + 99 others); Thu, 24 Sep 2020 03:32:49 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:14223 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727116AbgIXHct (ORCPT ); Thu, 24 Sep 2020 03:32:49 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 62F22D86E4925881FA69; Thu, 24 Sep 2020 15:32:47 +0800 (CST) Received: from huawei.com (10.175.127.227) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.487.0; Thu, 24 Sep 2020 15:32:39 +0800 From: "zhangyi (F)" To: CC: , , , Subject: [PATCH v2 4/7] ext4: use ext4_buffer_uptodate() in __ext4_get_inode_loc() Date: Thu, 24 Sep 2020 15:33:34 +0800 Message-ID: <20200924073337.861472-5-yi.zhang@huawei.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200924073337.861472-1-yi.zhang@huawei.com> References: <20200924073337.861472-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-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org We have already introduced ext4_buffer_uptodate() to re-set the uptodate bit on buffer which has been failed to write out to disk. Just remove the redundant codes and switch to use ext4_buffer_uptodate() in __ext4_get_inode_loc(). Signed-off-by: zhangyi (F) --- fs/ext4/inode.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 3661ed126c5f..171df289ef7e 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -4287,16 +4287,7 @@ static int __ext4_get_inode_loc(struct inode *inode, if (!buffer_uptodate(bh)) { lock_buffer(bh); - /* - * If the buffer has the write error flag, we have failed - * to write out another inode in the same block. In this - * case, we don't have to read the block because we may - * read the old inode data successfully. - */ - if (buffer_write_io_error(bh) && !buffer_uptodate(bh)) - set_buffer_uptodate(bh); - - if (buffer_uptodate(bh)) { + if (ext4_buffer_uptodate(bh)) { /* someone brought it uptodate while we waited */ unlock_buffer(bh); goto has_buffer; -- 2.25.4