From 875fb38be81dc1e1d80ef01420e6f611202588cb Mon Sep 17 00:00:00 2001 From: a17671 Date: Thu, 26 May 2022 16:42:15 +0800 Subject: [PATCH] mm:Clean page_io revert conflict Moto zram writeback has conflicts with mglru There is some merge error after reverted the zram writeback changes, clean it for correct logic Change-Id: I4ba5093dae7eab5ecc3cb16bab0ddfe793342306 Reviewed-on: https://gerrit.mot.com/2281591 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Xiangpo Zhao Submit-Approved: Jira Key --- mm/page_io.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mm/page_io.c b/mm/page_io.c index 855e7ea3615a..d83365305074 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -74,6 +74,7 @@ void end_swap_bio_write(struct bio *bio) bio_put(bio); } + static void end_swap_bio_read(struct bio *bio) { struct page *page = bio_first_page_all(bio); @@ -337,6 +338,13 @@ int swap_readpage(struct page *page, bool synchronous) goto out; } + ret = bdev_read_page(sis->bdev, swap_page_sector(page), page); + if (!ret) { + + count_vm_event(PSWPIN); + goto out; + } + ret = 0; bio = get_swap_bio(GFP_KERNEL, page, end_swap_bio_read); if (bio == NULL) {