Re: [PATCH 1/3] mm/gup: introduce __put_user_pages()

From: Christoph Hellwig
Date: Tue Jul 23 2019 - 11:36:46 EST


On Mon, Jul 22, 2019 at 11:33:32PM -0700, John Hubbard wrote:
> I'm seeing about 18 places where set_page_dirty() is used, in the call site
> conversions so far, and about 20 places where set_page_dirty_lock() is
> used. So without knowing how many of the former (if any) represent bugs,
> you can see why the proposal here supports both DIRTY and DIRTY_LOCK.

Well, it should be fairly easy to audit. set_page_dirty() is only
safe if we are dealing with a file backed page where we have reference
on the inode it hangs off. Which should basically be never or almost
never.