On Tue, Jun 15, 2010 at 06:53:41AM -0400, Christoph Hellwig wrote:
It's just a pretty simple use-after-free. Maybe people forget it because
->writepage is an asynchronous API.
There shouldn't be a problem _holding_ the locks, but there is a problem
waiting for multiple locks out of page->index order.
But there is a problem with holding the lock of a lot of pages while
calling ->writepage on them. So yeah, you can't do that.
Hmm, I should rediff that lockdep page_lock patch and get it merged.
(although I don't know if that can catch these all these problems easily)
--