From d3d6b84552c97c0fec9da6faa976fc08c8db336e Mon Sep 17 00:00:00 2001 From: Swapneel Mashalkar Date: Tue, 24 Jan 2023 09:57:14 +0000 Subject: [PATCH] UDC: Dm-Bow failed to load when size is not Multiple of 4096 BUG : 240098675 Skip Dm-Bow load incase size is not a Multiple of 4096. Rounding down does not hurt, since ext4 will only use full blocks Change-Id: Ie4e6634b2c49762e4669e66d94effc91d8e581ca Signed-off-by: Swapneel Mashalkar --- fs_mgr/fs_mgr.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs_mgr/fs_mgr.cpp b/fs_mgr/fs_mgr.cpp index 1c1ab48d4..742cdfab0 100644 --- a/fs_mgr/fs_mgr.cpp +++ b/fs_mgr/fs_mgr.cpp @@ -1176,6 +1176,10 @@ class CheckpointManager { return false; } + // dm-bow will not load if size is not a multiple of 4096 + // rounding down does not hurt, since ext4 will only use full blocks + size &= ~7; + android::dm::DmTable table; auto bowTarget = std::make_unique(0, size, entry->blk_device);