From: Matthew Wilcox (Oracle) Date: Wed, 10 Sep 2025 14:29:18 +0000 (+0100) Subject: mm: remove redundant test in validate_page_before_insert() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=6fd893a40e3c990ea4ca3a9c084d1ddc3020d936;p=users%2Fjedix%2Flinux-maple.git mm: remove redundant test in validate_page_before_insert() 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) Acked-by: David Hildenbrand Acked-by: Vlastimil Babka Signed-off-by: Andrew Morton --- diff --git a/mm/memory.c b/mm/memory.c index 41e641823558..17cebb97beae 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -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;