]> git.baikalelectronics.ru Git - kernel.git/commit
mm: fix infinite loop in filemap_fault
authorMiklos Szeredi <mszeredi@suse.cz>
Wed, 14 May 2008 23:05:37 +0000 (16:05 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 15 May 2008 02:11:13 +0000 (19:11 -0700)
commit2295698337b0ac1607417b2b3b69574ebc991c65
treee696a950d76c90199661515e1068fc00102a15bf
parent4c1abcf1ca11370f4abd4c69b8d600ee06b98641
mm: fix infinite loop in filemap_fault

filemap_fault will go into an infinite loop if ->readpage() fails
asynchronously.

AFAICS the bug was introduced by this commit, which removed the wait after the
final readpage:

   commit 83f769d767e274ff946dc7c8e0a030a32e9d580c
   Author: Nick Piggin <npiggin@suse.de>
   Date:   Thu Jul 19 01:46:57 2007 -0700

       mm: fix fault vs invalidate race for linear mappings

Fix by reintroducing the wait_on_page_locked() after ->readpage() to make sure
the page is up-to-date before jumping back to the beginning of the function.

I've noticed this while testing nfs exporting on fuse.  The patch
fixes it.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Cc: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/filemap.c