xfs: don't try to handle non-update pages in xfile_obj_load
authorChristoph Hellwig <hch@lst.de>
Mon, 19 Feb 2024 06:27:22 +0000 (07:27 +0100)
committerChandan Babu R <chandanbabu@kernel.org>
Wed, 21 Feb 2024 06:06:53 +0000 (11:36 +0530)
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 <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
fs/xfs/scrub/xfile.c

index c15cc88..4ec9759 100644 (file)
@@ -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: