- Add encrypted byte-offset initialization vector (eboiv) to DM crypt.

- Add optional discard features to DM snapshot which allow freeing space
  from a DM device whose free space was exhausted.

- Various small improvements to use struct_size() and kzalloc().

- Fix to check if DM thin metadata is in fail_io mode before attempting
  to update the superblock to set the needs_check flag.  Otherwise the
  DM thin-pool can hang.

- Fix DM bufio shrinker's potential for ABBA recursion deadlock with DM
  thin provisioning on loop usecase.
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>
1 file changed