Junxiao Bi
bd293d071f
dm bufio: fix deadlock with loop device
...
When thin-volume is built on loop device, if available memory is low,
the following deadlock can be triggered:
One process P1 allocates memory with GFP_FS flag, direct alloc fails,
memory reclaim invokes memory shrinker in dm_bufio, dm_bufio_shrink_scan()
runs, mutex dm_bufio_client->lock is acquired, then P1 waits for dm_buffer
IO to complete in __try_evict_buffer().
But this IO may never complete if issued to an underlying loop device
that forwards it using direct-IO, which allocates memory using
GFP_KERNEL (see: do_blockdev_direct_IO()). If allocation fails, memory
reclaim will invoke memory shrinker in dm_bufio, dm_bufio_shrink_scan()
will be invoked, and since the mutex is already held by P1 the loop
thread will hang, and IO will never complete. Resulting in ABBA
deadlock.
Cc: stable@vger.kernel.org
Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com >
Signed-off-by: Mike Snitzer <snitzer@redhat.com >
2019-07-12 09:59:37 -04:00
..
2019-05-24 17:36:47 +02:00
2019-06-05 17:37:17 +02:00
2019-06-05 17:36:37 +02:00
2019-06-05 17:36:37 +02:00
2019-06-13 03:17:11 -06:00
2019-05-30 11:26:41 -07:00
2019-05-30 11:26:32 -07:00
2019-06-13 17:34:56 -10:00
2019-06-13 03:17:50 -06:00
2019-06-05 17:37:06 +02:00
2019-05-30 11:26:41 -07:00
2019-06-05 17:37:18 +02:00
2019-06-05 17:37:18 +02:00
2019-06-16 07:22:56 -10:00
2019-05-30 11:26:35 -07:00
2019-06-05 17:37:17 +02:00
2019-06-05 17:37:16 +02:00
2019-06-05 17:37:17 +02:00
2019-06-13 17:34:56 -10:00
2019-05-24 17:27:11 +02:00
2019-06-05 17:36:37 +02:00
2019-06-08 12:52:42 -07:00
2019-06-08 12:52:42 -07:00
2019-06-05 17:37:17 +02:00
2019-05-30 11:29:53 -07:00
2019-06-05 17:36:37 +02:00
2019-05-30 11:26:35 -07:00
2019-06-05 17:37:18 +02:00
2019-05-24 17:36:45 +02:00
2019-06-08 12:52:42 -07:00
2019-05-30 11:26:41 -07:00
2019-06-14 05:48:29 -10:00
2019-06-14 17:55:22 +02:00
2019-06-13 05:59:05 -10:00
2019-06-05 17:37:07 +02:00
2019-06-05 17:37:05 +02:00
2019-06-08 12:52:42 -07:00
2019-06-12 12:54:06 +02:00
2019-06-05 17:37:06 +02:00
2019-06-05 17:37:06 +02:00
2019-06-05 17:37:18 +02:00
2019-06-08 12:52:42 -07:00
2019-06-05 17:37:17 +02:00
2019-06-14 05:49:35 -10:00
2019-06-05 17:37:17 +02:00
2019-06-05 17:37:06 +02:00
2019-05-31 08:34:32 -07:00
2019-06-05 17:37:17 +02:00
2019-06-05 17:37:14 +02:00
2019-06-05 17:37:10 +02:00
2019-06-05 17:36:37 +02:00
2019-06-05 17:37:17 +02:00
2019-07-12 09:59:37 -04:00
2019-06-12 05:57:05 -10:00
2019-06-05 17:37:07 +02:00
2019-05-28 09:53:54 +02:00
2019-06-05 17:37:18 +02:00
2019-06-08 12:52:42 -07:00
2019-06-08 12:52:42 -07:00
2019-06-05 17:37:17 +02:00
2019-06-08 12:52:42 -07:00
2019-06-05 17:37:15 +02:00
2019-06-05 17:36:37 +02:00
2019-06-13 17:34:56 -10:00
2019-06-07 14:04:28 -06:00
2019-06-05 17:36:38 +02:00
2019-06-05 17:37:16 +02:00
2019-06-08 12:52:42 -07:00
2019-06-08 12:50:36 -07:00
2019-06-13 17:34:56 -10:00
2019-06-05 17:30:27 +02:00
2019-06-05 17:36:37 +02:00
2019-06-05 17:37:18 +02:00
2019-06-05 17:37:18 +02:00
2019-06-12 11:49:20 +03:00
2019-05-30 11:25:19 -07:00
2019-06-05 17:37:18 +02:00
2019-06-05 17:37:04 +02:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:26:39 -07:00
2019-05-30 11:26:39 -07:00
2019-06-05 17:37:10 +02:00
2019-05-30 11:26:37 -07:00
2019-06-07 23:21:39 +02:00
2019-06-10 07:35:55 -10:00
2019-06-05 17:36:37 +02:00
2019-06-05 17:37:15 +02:00
2019-06-05 17:37:17 +02:00
2019-06-07 09:29:14 -07:00
2019-05-24 17:36:45 +02:00
2019-06-14 15:52:51 -10:00
2019-06-05 17:37:14 +02:00
2019-06-10 07:19:56 -10:00
2019-06-05 17:36:37 +02:00
2019-05-31 08:31:45 -07:00
2019-06-05 17:37:06 +02:00
2019-06-05 17:36:37 +02:00
2019-06-05 17:37:15 +02:00
2019-05-24 17:08:18 +02:00
2019-06-05 17:37:06 +02:00
2019-06-12 17:13:02 +02:00
2019-06-05 17:30:29 +02:00
2019-06-06 12:32:37 -06:00
2019-05-27 11:08:23 -04:00
2019-06-05 17:37:18 +02:00
2019-05-27 11:08:22 -04:00
2019-05-24 17:39:00 +02:00
2019-05-30 11:26:32 -07:00
2019-06-08 12:52:42 -07:00
2019-06-05 17:37:18 +02:00
2019-06-11 15:38:34 -10:00