Nikos Tsironis 8fdbfe8d16 dm clone metadata: Use a two phase commit
Split the metadata commit in two parts:

1. dm_clone_metadata_pre_commit(): Prepare the current transaction for
   committing. After this is called, all subsequent metadata updates,
   done through either dm_clone_set_region_hydrated() or
   dm_clone_cond_set_range(), will be part of the next transaction.

2. dm_clone_metadata_commit(): Actually commit the current transaction
   to disk and start a new transaction.

This is required by the following commit. It allows dm-clone to flush
the destination device after step (1) to ensure that all freshly
hydrated regions, for which we are updating the metadata, are properly
written to non-volatile storage and won't be lost in case of a crash.

Fixes: 7431b7835f55 ("dm: add clone target")
Cc: stable@vger.kernel.org # v5.4+
Signed-off-by: Nikos Tsironis <ntsironis@arrikto.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2019-12-05 15:27:54 -05:00
..
2019-09-17 16:57:47 -07:00
2019-09-16 10:18:01 -04:00
2019-09-04 09:39:22 -04:00
2019-11-05 14:21:40 -05:00
2019-08-23 10:13:12 -04:00
2019-08-23 10:13:12 -04:00
2019-11-20 10:35:31 -05:00
2019-09-12 09:32:31 -04:00
2019-03-12 10:15:18 -07:00
2019-09-13 13:14:39 -07:00