- The most significant set of changes this cycle is the Forward Error
  Correction (FEC) support that has been added to the DM verity target.
  Google uses DM verity on all Android devices and it is believed that
  this FEC support will enable DM verity to recover from storage
  failures seen since DM verity was first deployed as part of Android.

- A stable fix for a race in the destruction of DM thin pool's workqueue

- A stable fix for hung IO if a DM snapshot copy hit an error

- A few small cleanups in DM core and DM persistent data.

- A couple DM thinp range discard improvements (address atomicity of
  finding a range and the efficiency of discarding a partially mapped
  thin device)

- Add ability to debug DM bufio leaks by recording stack trace when a
  buffer is allocated.  Upon detected leak the recorded stack is dumped.
dm snapshot: fix hung bios when copy error occurs

When there is an error copying a chunk dm-snapshot can incorrectly hold
associated bios indefinitely, resulting in hung IO.

The function copy_callback sets pe->error if there was error copying the
chunk, and then calls complete_exception.  complete_exception calls
pending_complete on error, otherwise it calls commit_exception with
commit_callback (and commit_callback calls complete_exception).

The persistent exception store (dm-snap-persistent.c) assumes that calls
to prepare_exception and commit_exception are paired.
persistent_prepare_exception increases ps->pending_count and
persistent_commit_exception decreases it.

If there is a copy error, persistent_prepare_exception is called but
persistent_commit_exception is not.  This results in the variable
ps->pending_count never returning to zero and that causes some pending
exceptions (and their associated bios) to be held forever.

Fix this by unconditionally calling commit_exception regardless of
whether the copy was successful.  A new "valid" parameter is added to
commit_exception -- when the copy fails this parameter is set to zero so
that the chunk that failed to copy (and all following chunks) is not
recorded in the snapshot store.  Also, remove commit_callback now that
it is merely a wrapper around pending_complete.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org
4 files changed