Skip to contentSkip to conversation

mm-memory-fix-folio_set_dirty-vs-folio_mark_dirty-in-zap_pte_range.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Jan 26, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/memory: fix folio_set_dirty() vs. folio_mark_dirty() in zap_pte_range()
has been removed from the -mm tree. Its filename was
mm-memory-fix-folio_set_dirty-vs-folio_mark_dirty-in-zap_pte_range.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/memory: fix folio_set_dirty() vs. folio_mark_dirty() in zap_pte_range()
Date: Mon, 22 Jan 2024 18:17:51 +0100

The correct folio replacement for "set_page_dirty()" is "folio_mark_dirty()", not "folio_set_dirty()". Using the latter won't properly inform the FS using the dirty_folio() callback.

This has been found by code inspection, but likely this can result in some real trouble when zapping dirty PTEs that point at clean pagecache folios.

Yuezhang Mo said: "Without this fix, testing the latest exfat with xfstests, test cases generic/029 and generic/030 will fail."

---

 mm/memory.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memory.c renamed from mm/memory.c~mm-memory-fix-folio_set_dirty-vs-folio_mark_dirty-in-zap_pte_range +1 -1
@@ -1464,7 +1464,7 @@ static unsigned long zap_pte_range(struc
 			delay_rmap = 0;
 			if (!folio_test_anon(folio)) {
 				if (pte_dirty(ptent)) {
-					folio_set_dirty(folio);
+					folio_mark_dirty(folio);
 					if (tlb_delay_rmap(tlb)) {
 						delay_rmap = 1;
 						force_flush = 1;

_

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