Re: zram corruption due to uninitialized do_swap_page fault

From: Ivan Babrou
Date: Tue Mar 15 2022 - 00:55:02 EST


On Mon, Mar 14, 2022 at 9:34 PM Hillf Danton <hdanton@xxxxxxxx> wrote:
> Can you test if the race comes from the diff below wrt zram_free_page?
>
> Hillf
>
> --- upstream/mm/page_io.c
> +++ b/mm/page_io.c
> @@ -392,11 +392,6 @@ int swap_readpage(struct page *page, boo
> if (sis->flags & SWP_SYNCHRONOUS_IO) {
> ret = bdev_read_page(sis->bdev, swap_page_sector(page), page);
> if (!ret) {
> - if (trylock_page(page)) {
> - swap_slot_free_notify(page);
> - unlock_page(page);
> - }
> -
> count_vm_event(PSWPIN);
> goto out;
> }

I tried it without the previous patch (the one commenting out
swap_slot_free_notify in end_swap_bio_read) and it still fails.