From: Jan Kara Date: Thu, 23 Jun 2011 20:51:47 +0000 (+0200) Subject: ocfs2: Avoid livelock in ocfs2_readpage() X-Git-Tag: v3.2-rc4~1^2~9 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7e25e6e0b0486492c5faaf6312b37413642c48e;p=pandora-kernel.git ocfs2: Avoid livelock in ocfs2_readpage() When someone writes to an inode, readers accessing the same inode via ocfs2_readpage() just busyloop trying to get ip_alloc_sem because do_generic_file_read() looks up the page again and retries ->readpage() when previous attempt failed with AOP_TRUNCATED_PAGE. When there are enough readers, they can occupy all CPUs and in non-preempt kernel the system is deadlocked because writer holding ip_alloc_sem is never run to release the semaphore. Fix the problem by making reader block on ip_alloc_sem to break the busy loop. Signed-off-by: Jan Kara Signed-off-by: Joel Becker --- Reading git-diff-tree failed