filemap: Update the folio_mark_dirty documentation

The previous comment was not terribly helpful.  Be a bit more explicit
about the necessary locking environment.
Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
parent cd125eea
...@@ -2602,10 +2602,12 @@ EXPORT_SYMBOL(folio_redirty_for_writepage); ...@@ -2602,10 +2602,12 @@ EXPORT_SYMBOL(folio_redirty_for_writepage);
* folio_mark_dirty - Mark a folio as being modified. * folio_mark_dirty - Mark a folio as being modified.
* @folio: The folio. * @folio: The folio.
* *
* For folios with a mapping this should be done with the folio lock held * The folio may not be truncated while this function is running.
* for the benefit of asynchronous memory errors who prefer a consistent * Holding the folio lock is sufficient to prevent truncation, but some
* dirty state. This rule can be broken in some special cases, * callers cannot acquire a sleeping lock. These callers instead hold
* but should be better not to. * the page table lock for a page table which contains at least one page
* in this folio. Truncation will block on the page table lock as it
* unmaps pages before removing the folio from its mapping.
* *
* Return: True if the folio was newly dirtied, false if it was already dirty. * Return: True if the folio was newly dirtied, false if it was already dirty.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment