From c8a326aab7b268873e4418252d50ab92e5f81b92 Mon Sep 17 00:00:00 2001 From: Pavel Snajdr Date: Tue, 3 Dec 2024 01:25:35 +0100 Subject: [PATCH] Linux: fix zfs_uio_dio_check_for_zero_page The intent here is to replace the zero page pointer in the array of pointers to pages in the struct. Reviewed-by: Alexander Motin Reviewed-by: Brian Behlendorf Signed-off-by: Pavel Snajdr Closes #16812 Closes #16689 Closes #16642 --- module/os/linux/zfs/zfs_uio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/os/linux/zfs/zfs_uio.c b/module/os/linux/zfs/zfs_uio.c index 0146d8423..f08415fdb 100644 --- a/module/os/linux/zfs/zfs_uio.c +++ b/module/os/linux/zfs/zfs_uio.c @@ -546,8 +546,9 @@ zfs_uio_dio_check_for_zero_page(zfs_uio_t *uio) unlock_page(p); put_page(p); - p = __page_cache_alloc(gfp_zero_page); - zfs_mark_page(p); + uio->uio_dio.pages[i] = + __page_cache_alloc(gfp_zero_page); + zfs_mark_page(uio->uio_dio.pages[i]); } else { unlock_page(p); }