From: Christoph Hellwig Date: Mon, 19 Feb 2024 06:27:22 +0000 (+0100) Subject: xfs: don't try to handle non-update pages in xfile_obj_load X-Git-Tag: v6.9-rc1~129^2~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0e2a24afb99258acc147f7fbe6c1e178a951247d;p=thirdparty%2Fkernel%2Flinux.git xfs: don't try to handle non-update pages in xfile_obj_load shmem_read_mapping_page_gfp always returns an uptodate page or an ERR_PTR. Remove the code that tries to handle a non-uptodate page. Signed-off-by: Christoph Hellwig Reviewed-by: "Darrick J. Wong" Signed-off-by: Chandan Babu R --- diff --git a/fs/xfs/scrub/xfile.c b/fs/xfs/scrub/xfile.c index c15cc88688800..4ec975977dcd4 100644 --- a/fs/xfs/scrub/xfile.c +++ b/fs/xfs/scrub/xfile.c @@ -149,18 +149,14 @@ xfile_load( goto advance; } - if (PageUptodate(page)) { - /* - * xfile pages must never be mapped into userspace, so - * we skip the dcache flush. - */ - kaddr = kmap_local_page(page); - p = kaddr + offset_in_page(pos); - memcpy(buf, p, len); - kunmap_local(kaddr); - } else { - memset(buf, 0, len); - } + /* + * xfile pages must never be mapped into userspace, so + * we skip the dcache flush. + */ + kaddr = kmap_local_page(page); + p = kaddr + offset_in_page(pos); + memcpy(buf, p, len); + kunmap_local(kaddr); put_page(page); advance: