mm/writeback: Improve __folio_mark_dirty() comment
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Sun, 20 Dec 2020 11:44:51 +0000 (06:44 -0500)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 3 Jan 2022 01:28:57 +0000 (20:28 -0500)
Add some notes about how this function needs to be called.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: William Kucharski <william.kucharski@oracle.com>
mm/page-writeback.c

index a613f8ef6a0209cf5a940ea61cdfbd6c6c35dadf..91d163f8d36b2f69e97bdee62f4224d5c9583676 100644 (file)
@@ -2496,7 +2496,11 @@ void folio_account_cleaned(struct folio *folio, struct address_space *mapping,
  * If warn is true, then emit a warning if the folio is not uptodate and has
  * not been truncated.
  *
- * The caller must hold lock_page_memcg().
+ * The caller must hold lock_page_memcg().  Most callers have the folio
+ * locked.  A few have the folio blocked from truncation through other
+ * means (eg zap_page_range() has it mapped and is holding the page table
+ * lock).  This can also be called from mark_buffer_dirty(), which I
+ * cannot prove is always protected against truncate.
  */
 void __folio_mark_dirty(struct folio *folio, struct address_space *mapping,
                             int warn)