]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm: remove redundant test in validate_page_before_insert()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 10 Sep 2025 14:29:18 +0000 (15:29 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 21 Sep 2025 21:22:32 +0000 (14:22 -0700)
The page_has_type() call would have included slab since commit
46df8e73a4a3 and now we don't even get that far because slab pages have a
zero refcount since commit 9aec2fb0fd5e.

Link: https://lkml.kernel.org/r/20250910142923.2465470-3-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: David Hildenbrand <david@redhat.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memory.c

index 41e641823558cfecd5ec83b65f9fc3f11f07c661..17cebb97beaeab334abed179b3b005caf5c4554d 100644 (file)
@@ -2266,8 +2266,7 @@ static int validate_page_before_insert(struct vm_area_struct *vma,
                        return -EINVAL;
                return 0;
        }
-       if (folio_test_anon(folio) || folio_test_slab(folio) ||
-           page_has_type(page))
+       if (folio_test_anon(folio) || page_has_type(page))
                return -EINVAL;
        flush_dcache_folio(folio);
        return 0;