Skip to contentSkip to conversation

mm-sanity-check-maximum-folio-size-in-folio_set_order.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Sep 21, 2025

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm: sanity-check maximum folio size in folio_set_order()
has been removed from the -mm tree. Its filename was
mm-sanity-check-maximum-folio-size-in-folio_set_order.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: David Hildenbrand <[email protected]>
Subject: mm: sanity-check maximum folio size in folio_set_order()
Date: Mon, 1 Sep 2025 17:03:31 +0200

Let's sanity-check in folio_set_order() whether we would be trying to create a folio with an order that would make it exceed MAX_FOLIO_ORDER.

This will enable the check whenever a folio/compound page is initialized through prepare_compound_head() / prepare_compound_page() with CONFIG_DEBUG_VM set.

---

 mm/internal.h |    1 +
 1 file changed, 1 insertion(+)
mm/internal.h renamed from mm/internal.h~mm-sanity-check-maximum-folio-size-in-folio_set_order +1 -0
@@ -755,6 +755,7 @@ static inline void folio_set_order(struc
 {
 	if (WARN_ON_ONCE(!order || !folio_test_large(folio)))
 		return;
+	VM_WARN_ON_ONCE(order > MAX_FOLIO_ORDER);
 
 	folio->_flags_1 = (folio->_flags_1 & ~0xffUL) | order;
 #ifdef NR_PAGES_IN_LARGE_FOLIO

_

Patches currently in -mm which might be from [email protected] are