Revision 3b6b7813b198b578aa7e04e4047ddb8225c37b7f authored by Mikulas Patocka on 20 March 2013, 17:21:25 UTC, committed by Alasdair G Kergon on 20 March 2013, 17:21:25 UTC
A deadlock was found in the prefetch code in the dm verity map function. This patch fixes this by transferring the prefetch to a worker thread and skipping it completely if kmalloc fails. If generic_make_request is called recursively, it queues the I/O request on the current->bio_list without making the I/O request and returns. The routine making the recursive call cannot wait for the I/O to complete. The deadlock occurs when one thread grabs the bufio_client mutex and waits for an I/O to complete but the I/O is queued on another thread's current->bio_list and is waiting to get the mutex held by the first thread. The fix recognises that prefetching is not essential. If memory can be allocated, it queues the prefetch request to the worker thread, but if not, it does nothing. Signed-off-by: Paul Taysom <taysom@chromium.org> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com> Cc: stable@kernel.org
1 parent 58051b9
File | Mode | Size |
---|---|---|
Kconfig | -rw-r--r-- | 1.2 KB |
Makefile | -rw-r--r-- | 178 bytes |
xz_crc32.c | -rw-r--r-- | 1.2 KB |
xz_dec_bcj.c | -rw-r--r-- | 13.6 KB |
xz_dec_lzma2.c | -rw-r--r-- | 28.4 KB |
xz_dec_stream.c | -rw-r--r-- | 19.3 KB |
xz_dec_syms.c | -rw-r--r-- | 664 bytes |
xz_dec_test.c | -rw-r--r-- | 5.2 KB |
xz_lzma2.h | -rw-r--r-- | 6.0 KB |
xz_private.h | -rw-r--r-- | 4.4 KB |
xz_stream.h | -rw-r--r-- | 1.4 KB |
Computing file changes ...