mm: write_cache_pages terminate quickly
authorNick Piggin <npiggin@suse.de>
Tue, 6 Jan 2009 22:39:11 +0000 (14:39 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 25 Jan 2009 00:36:27 +0000 (16:36 -0800)
commite55e8f16723d5017aff16547e259e2c35766e4ad
treeaf78dedd810f767a1d5c8e8e56800bcfa94f82c4
parent65cdf4090b2a70726bed638e7c41bb3f952d0076
mm: write_cache_pages terminate quickly

commit d5482cdf8a0aacb1e6468a97d5544f5829c8d8c4 upstream.

Terminate the write_cache_pages loop upon encountering the first page past
end, without locking the page.  Pages cannot have their index change when
we have a reference on them (truncate, eg truncate_inode_pages_range
performs the same check without the page lock).

Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: Chris Mason <chris.mason@oracle.com>
Cc: Dave Chinner <david@fromorbit.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
mm/page-writeback.c