]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
mm: tiny-shmem fix lock ordering: mmap_sem vs i_mutex
authorNick Piggin <npiggin@suse.de>
Mon, 22 Sep 2008 20:57:50 +0000 (13:57 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 23 Sep 2008 15:09:14 +0000 (08:09 -0700)
tiny-shmem calls do_truncate in shmem_file_setup.  do_truncate takes
i_mutex, and shmem_file_setup is called with mmap_sem held.  However
i_mutex nests outside mmap_sem.

Copy the code in shmem.c to avoid this problem.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Nick Piggin <npiggin@suse.de>
Reported-and-tested-by: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Matt Mackall <mpm@selenic.com>
Cc: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

No differences found