Skip to content

Commit e4e3df2

Browse files
davidhildenbrandakpm00
authored andcommitted
mm/memory: fix folio_set_dirty() vs. folio_mark_dirty() in zap_pte_range()
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." Link: https://lkml.kernel.org/r/[email protected] Fixes: c462650 ("mm/memory: page_remove_rmap() -> folio_remove_rmap_pte()") Signed-off-by: David Hildenbrand <[email protected]> Reported-by: Ryan Roberts <[email protected]> Closes: https://lkml.kernel.org/r/[email protected] Reviewed-by: Ryan Roberts <[email protected]> Cc: Matthew Wilcox (Oracle) <[email protected]> Reviewed-by: Yuezhang Mo <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent db44c65 commit e4e3df2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/memory.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1464,7 +1464,7 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb,
14641464
delay_rmap = 0;
14651465
if (!folio_test_anon(folio)) {
14661466
if (pte_dirty(ptent)) {
1467-
folio_set_dirty(folio);
1467+
folio_mark_dirty(folio);
14681468
if (tlb_delay_rmap(tlb)) {
14691469
delay_rmap = 1;
14701470
force_flush = 1;

0 commit comments

Comments
 (0)