Skip to contentSkip to conversation

md-use-folio-apis-in-free_page.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Oct 9

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: md: use folio APIs in free_page()
has been removed from the -mm tree. Its filename was
md-use-folio-apis-in-free_page.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: "Matthew Wilcox (Oracle)" <[email protected]>
Subject: md: use folio APIs in free_page()
Date: Sun, 20 Sep 2026 22:28:10 -0400

Convert the page to a folio. This removes some of the last uses of a few page APIs (detach_page_private(), page_buffers()). Replaces two calls to compound_head() with one.

Remove the early return in free_buffers() to avoid memory leak and uninitialized file bitmap pages.[1][2]

---

 drivers/md/md-bitmap.c |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/md/md-bitmap.c renamed from drivers/md/md-bitmap.c~md-use-folio-apis-in-free_page +3 -7
@@ -533,19 +533,15 @@ static void write_file_page(struct bitma
 
 static void free_buffers(struct page *page)
 {
-	struct buffer_head *bh;
+	struct folio *folio = page_folio(page);
+	struct buffer_head *bh = folio_detach_private(folio);
 
-	if (!PagePrivate(page))
-		return;
-
-	bh = page_buffers(page);
 	while (bh) {
 		struct buffer_head *next = bh->b_this_page;
 		free_buffer_head(bh);
 		bh = next;
 	}
-	detach_page_private(page);
-	put_page(page);
+	folio_put(folio);
 }
 
 /* read a page from a file.

_

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