Add length parameter to format /data
With metadata encryption, if partition is wiped (or) cryptfs failed , it will do format without length which make partition size is grown large to occupy remaining space instead of restricting the Android defined partition size
Bug: 343159184
Test: Add length flag in fstab && fastboot erase userdata && fastboot reboot && df -h /data
Signed-off-by: Ashok Mutyala <quic_amutyala@quicinc.com>
Change-Id: Ifce4b78df5edb899c84a032004895802766cd5cf
diff --git a/fs_mgr/fs_mgr.cpp b/fs_mgr/fs_mgr.cpp
index 7f41cea..5156754 100644
--- a/fs_mgr/fs_mgr.cpp
+++ b/fs_mgr/fs_mgr.cpp
@@ -1556,6 +1556,7 @@
attempted_entry.mount_point, wiped ? "true" : "false",
attempted_entry.fs_type,
attempted_entry.fs_mgr_flags.is_zoned ? "true" : "false",
+ std::to_string(attempted_entry.length),
android::base::Join(attempted_entry.user_devices, ' ')},
nullptr)) {
LERROR << "Encryption failed";
@@ -1601,6 +1602,7 @@
current_entry.mount_point, "true" /* shouldFormat */,
current_entry.fs_type,
current_entry.fs_mgr_flags.is_zoned ? "true" : "false",
+ std::to_string(current_entry.length),
android::base::Join(current_entry.user_devices, ' ')},
nullptr)) {
LERROR << "Encryption failed";