android_kernel_samsung_sm8650/Documentation/device-mapper
Paul Lawrence f7bdfc05d1 ANDROID: dm-bow: Add dm-bow feature
Based on https://www.redhat.com/archives/dm-devel/2019-March/msg00025.html

Third version of dm-bow. Key changes:

Free list added
Support for block sizes other than 4k
Handles writes during trim phase, and overlapping trims
Integer overflow error
Support trims even if underlying device doesn't
Numerous small bug-fixes

bow == backup on write

USE CASE:

dm-bow takes a snapshot of an existing file system before mounting.
The user may, before removing the device, commit the snapshot.
Alternatively the user may remove the device and then run a command
line utility to restore the device to its original state.

dm-bow does not require an external device

dm-bow efficiently uses all the available free space on the file system.

IMPLEMENTATION:

dm-bow can be in one of three states.

In state one, the free blocks on the device are identified by issuing
an FSTRIM to the filesystem.

In state two, any writes cause the overwritten data to be backup up
to the available free space. While in this state, the device can be
restored by unmounting the filesystem, removing the dm-bow device
and running a usermode tool over the underlying device.

In state three, the changes are committed, dm-bow is in pass-through
mode and the drive can no longer be restored.

It is planned to use this driver to enable restoration of a failed
update attempt on Android devices using ext4.

Test: Can boot Android with userdata mounted on this device. Can commit
userdata after SUW has run. Can then reboot, make changes and roll back.

Known issues:

Mutex is held around entire flush operation, including lengthy I/O. Plan
is to convert to state machine with pending queues.

Interaction with block encryption is unknown, especially with respect
to sector 0.

Test: Dogfooded on Wahoo.
      Ran under Cuttlefish, running VtsKernelBowTest &
      VtsKernelCheckpointTest tests against 4.19, 4.14 & 4.9 kernels
Signed-off-by: Paul Lawrence <paullawrence@google.com>

Git-commit: 0ce3eb37e9
Git-repo: https://android.googlesource.com/kernel/common.

This snapshot is taken as of msm-5.15 branch commit 63a1e5f1d07a2
("ANDROID: dm-bow: Add dm-bow feature").

Change-Id: I3c963b6e296200f63069a9049b66000c703dac2e
Signed-off-by: Manjunatha N <quic_manjn@quicinc.com>
2023-12-03 21:46:52 -08:00
..
dm-bow.txt ANDROID: dm-bow: Add dm-bow feature 2023-12-03 21:46:52 -08:00