locks: fix possible infinite loop in posix deadlock detection
commitf153577e808532933e2cbe935e68c51be4c9a4b8
authorJ. Bruce Fields <bfields@citi.umich.edu>
Tue, 30 Oct 2007 15:20:02 +0000 (30 11:20 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 16 Nov 2007 16:12:42 +0000 (16 08:12 -0800)
treeabad094e9bc473f31367fe3db63b88a086c848d7
parente354b801daa5649ae32e04b6e83d7f35fbde3490
locks: fix possible infinite loop in posix deadlock detection

patch 97855b49b6bac0bd25f16b017883634d13591d00 in mainline.

It's currently possible to send posix_locks_deadlock() into an infinite
loop (under the BKL).

For now, fix this just by bailing out after a few iterations.  We may
want to fix this in a way that better clarifies the semantics of
deadlock detection.  But that will take more time, and this minimal fix
is probably adequate for any realistic scenario, and is simple enough to
be appropriate for applying to stable kernels now.

Thanks to George Davis for reporting the problem.

Cc: "George G. Davis" <gdavis@mvista.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/locks.c