Fix possible splice() mmap_sem deadlock
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 1 Oct 2007 20:17:28 +0000 (13:17 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 1 Oct 2007 20:17:28 +0000 (13:17 -0700)
Nick Piggin points out that splice isn't being good about the mmap
semaphore: while two readers can nest inside each others, it does leave
a possible deadlock if a writer (ie a new mmap()) comes in during that
nesting.

Original "just move the locking" patch by Nick, replaced by one by me
based on an optimistic pagefault_disable().  And then Jens tested and
updated that patch.

Reported-by: Nick Piggin <npiggin@suse.de>
Tested-by: Jens Axboe <jens.axboe@oracle.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

No differences found