Message ID | 20240125130947.600632-2-r.smirnov@omp.ru (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | mm/truncate: fix WARNING in ext4_set_page_dirty() | expand |
diff --git a/mm/truncate.c b/mm/truncate.c index 8914ca4ce4b1..989bc7785d55 100644 --- a/mm/truncate.c +++ b/mm/truncate.c @@ -256,7 +256,9 @@ int invalidate_inode_page(struct page *page) return 0; if (PageDirty(page) || PageWriteback(page)) return 0; - if (page_mapped(page)) + /* The refcount will be elevated if the page is used by the system */ + if (page_ref_count(page) > + compound_nr(page) + page_has_private(page) + 1) return 0; return invalidate_complete_page(mapping, page); }