Hugh Dickins 90ed52ebe4 [PATCH] holepunch: fix mmap_sem i_mutex deadlock
sys_madvise has down_write of mmap_sem, then madvise_remove calls
vmtruncate_range which takes i_mutex and i_alloc_sem: no, we can easily devise
deadlocks from that ordering.

madvise_remove drop mmap_sem while calling vmtruncate_range: luckily, since
madvise_remove doesn't split or merge vmas, it's easy to handle this case with
a NULL prev, without restructuring sys_madvise.  (Though sad to retake
mmap_sem when it's unlikely to be needed, and certainly down_read is
sufficient for MADV_REMOVE, unlike the other madvices.)

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: Miklos Szeredi <mszeredi@suse.cz>
Cc: Badari Pulavarty <pbadari@us.ibm.com>
Cc: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-03-29 08:22:26 -07:00
..
2007-03-27 08:52:47 +02:00
2006-12-22 08:55:49 -08:00
2007-02-11 10:51:17 -08:00
2006-09-26 08:48:44 -07:00
2007-01-11 18:18:20 -08:00
2007-02-15 09:57:03 -08:00
2006-12-07 08:39:22 -08:00
2007-03-01 14:53:38 -08:00
2006-09-26 08:48:45 -07:00
2005-04-16 15:20:36 -07:00
2007-02-11 10:51:18 -08:00