Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7957131rwp; Wed, 19 Jul 2023 03:04:50 -0700 (PDT) X-Google-Smtp-Source: APBJJlEDZDF99KO8AEjIrgljSbnOzn9zlv3VKuBGym0O/yR1YMokm3/2vAj77Zp1RiH24bUH5wb6 X-Received: by 2002:a05:6a00:1911:b0:682:5634:3df1 with SMTP id y17-20020a056a00191100b0068256343df1mr24555356pfi.10.1689761090123; Wed, 19 Jul 2023 03:04:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689761090; cv=none; d=google.com; s=arc-20160816; b=cGFaMamATtE8srwgJnsb5MGSigUsrvXRnIgEnuNwyFh1fTNzIfK7BM+nWFyuz8KCYM kFP1ujCF6PumShuy/HCdspdC991B3O4CKfzB994ZuBYQoPQ8IxL9mn5F1+almRuYCOS/ /MTaJyhWtMR1O6iPnXtTXbNqmQwKDZSvOtbkWRTaUyjggZfYl+KGD4vEOSG6VYZ/X+J4 hgTCbdrf3hdZSJP4Rck66QkHFxaTwkcWvJ2omxnR/W+faa3P8wI7bAY3CiFjhKv7HX+k koYFxl7XrFq6i3X6Zq+IJG7azXfihcOWeMXFo7DxjqSCeO13Ubw04bfoc29cnouHEsAb YxEQ== 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=wN9Jy/8pPyEHOuZ2Lb/sCQ9C45wtfFLi31VZgiAcDtY=; fh=fQ8bSAglEIUMWaW8g2fbwjC8kqQICqHTc4sMCYJe224=; b=VeKFLXqqEOnPt4hPjTMsPkhkGeH0P1jKci6aScxFPFG9i4H3Ndw+vbL81SAIIYksF2 HVi91H6UPtLA3QkF9gIAnhrmGZaW3NTdYJ25jQ+vIzhkjaOA7wAUwkC/+/odgQD9V5JM gwcrOjEMF9z3hHIqeqwhx0PJBdQhk1yXWwJ0kgtXD6LI1dbIzl/whsGmQwgBjHgLR9Vw a9t/eatPTLmVHUSMk/sPMtdgeB3hP9V1869//HuQE107zselVLSp+SolQf9747TXAph/ 7BOLVnj9z6urZrhQINxm1PuA22z1OoBvkLUbYQnvY2WwYu1Bi7Dw1PWk6Eq0vecs4z/O UJ1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eb28-20020a056a004c9c00b0068225e629aesi3077119pfb.0.2023.07.19.03.04.38; Wed, 19 Jul 2023 03:04:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230339AbjGSJ7C (ORCPT + 99 others); Wed, 19 Jul 2023 05:59:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230004AbjGSJ66 (ORCPT ); Wed, 19 Jul 2023 05:58:58 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54FDE10D4 for ; Wed, 19 Jul 2023 02:58:57 -0700 (PDT) Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4R5WQv5t2TzNmPb; Wed, 19 Jul 2023 17:55:35 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by kwepemm600020.china.huawei.com (7.193.23.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 19 Jul 2023 17:58:54 +0800 From: Peng Zhang To: , , CC: , , , , ZhangPeng Subject: [PATCH v2 2/9] mm/page_io: remove unneeded SetPageError() Date: Wed, 19 Jul 2023 17:58:41 +0800 Message-ID: <20230719095848.3422629-3-zhangpeng362@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230719095848.3422629-1-zhangpeng362@huawei.com> References: <20230719095848.3422629-1-zhangpeng362@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600020.china.huawei.com (7.193.23.147) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: ZhangPeng Nobody checks the PageError()/folio_test_error() for the page/folio in __end_swap_bio_read/write() and sio_write_complete(). Therefore, we don't need to set the error flag. Just drop it. Suggested-by: Matthew Wilcox (Oracle) Signed-off-by: ZhangPeng --- mm/page_io.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index 3087a69a014b..5ddb5d9c5013 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -32,7 +32,6 @@ static void __end_swap_bio_write(struct bio *bio) struct page *page = bio_first_page_all(bio); if (bio->bi_status) { - SetPageError(page); /* * We failed to write the page out to swap-space. * Re-dirty the page in order to avoid it being reclaimed. @@ -61,7 +60,6 @@ static void __end_swap_bio_read(struct bio *bio) struct page *page = bio_first_page_all(bio); if (bio->bi_status) { - SetPageError(page); pr_alert_ratelimited("Read-error on swap-device (%u:%u:%llu)\n", MAJOR(bio_dev(bio)), MINOR(bio_dev(bio)), (unsigned long long)bio->bi_iter.bi_sector); @@ -415,7 +413,6 @@ static void sio_read_complete(struct kiocb *iocb, long ret) for (p = 0; p < sio->pages; p++) { struct page *page = sio->bvec[p].bv_page; - SetPageError(page); unlock_page(page); } pr_alert_ratelimited("Read-error on swap-device\n"); -- 2.25.1