snapuserd: fix race condition during merge-resume
When resuming a merge after a crash, a race condition can occur where
a block is written to both the scratch space and the base device, but
the merge is not yet committed.
This change ensures that when a merge is resumed, the scratch space is
always checked first. Data from the scratch space is prioritized over
the source block to handle overlapping blocks and XOR ops correctly.
This prevents returning wrong data by ensuring that the most up-to-date
block is used when serving the io.
Bug: 441666433
Test: th, manual OTA and reboots
Change-Id: Idacef9726d3f91a3e416f2b56e531a208d213232
Signed-off-by:
Sandeep Dhavale <dhavale@google.com>
Loading
Please register or sign in to comment