lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 20 Jul 2023 21:01:38 +0800
From:   Peng Zhang <zhangpeng362@...wei.com>
To:     <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
        <willy@...radead.org>
CC:     <hch@...radead.org>, <sidhartha.kumar@...cle.com>,
        <akpm@...ux-foundation.org>, <wangkefeng.wang@...wei.com>,
        <sunnanyong@...wei.com>, ZhangPeng <zhangpeng362@...wei.com>
Subject: [PATCH v3 01/10] mm/page_io: remove unneeded ClearPageUptodate()

From: ZhangPeng <zhangpeng362@...wei.com>

The VM_BUG_ON_FOLIO in swap_readpage() ensures that the page is already
!uptodate in __end_swap_bio_read() and sio_read_complete().
Just remove unneeded ClearPageUptodate().

Suggested-by: Matthew Wilcox (Oracle) <willy@...radead.org>
Signed-off-by: ZhangPeng <zhangpeng362@...wei.com>
---
 mm/page_io.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/mm/page_io.c b/mm/page_io.c
index 8741d3a0d48a..3087a69a014b 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -62,7 +62,6 @@ static void __end_swap_bio_read(struct bio *bio)
 
 	if (bio->bi_status) {
 		SetPageError(page);
-		ClearPageUptodate(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);
@@ -417,7 +416,6 @@ static void sio_read_complete(struct kiocb *iocb, long ret)
 			struct page *page = sio->bvec[p].bv_page;
 
 			SetPageError(page);
-			ClearPageUptodate(page);
 			unlock_page(page);
 		}
 		pr_alert_ratelimited("Read-error on swap-device\n");
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ