Re: [PATCH 11/12] vmscan: Write out dirty pages in batch
From: Nick Piggin <hidden>
Date: 2010-06-15 11:13:37
Also in:
linux-fsdevel, lkml
On Tue, Jun 15, 2010 at 06:53:41AM -0400, Christoph Hellwig wrote:
quoted
+ /* + * XXX: This is the Holy Hand Grenade of PotentiallyInvalidMapping. As + * the page lock has been dropped by ->writepage, that mapping could + * be anything + */Why is this an XXX comment?
It's just a pretty simple use-after-free. Maybe people forget it because ->writepage is an asynchronous API.
quoted
+ * + * XXX: Is there a problem with holding multiple page locks like this?I think there is. There's quite a few places that do hold multiple pages locked, but they always lock pages in increasing page->inxex order. Given that this locks basically in random order it could cause problems for those places.
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) -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>